	.file	"extr_sis7019.c_sis_ac97_rw.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"ac97 codec %d timeout cmd 0x%08x\n"
	.text
	.p2align 4
	.type	sis_ac97_rw, @function
sis_ac97_rw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, 16[rdi]
	lea	rax, codec_ready.1958[rip]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, 65535
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbp, QWORD PTR [rdi]
	mov	rdi, r15
	mov	DWORD PTR 12[rsp], edx
	movsx	rdx, esi
	mov	r12d, DWORD PTR [rax+rdx*4]
	call	mutex_lock@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	sub	ebx, 1
	je	.L25
	mov	edi, 1
	call	udelay@PLT
.L2:
	mov	rdi, QWORD PTR SIS_AC97_SEMA[rip]
	add	rdi, rbp
	call	inw@PLT
	test	DWORD PTR SIS_AC97_SEMA_BUSY[rip], eax
	jne	.L26
	mov	ebx, 65535
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, 1
	call	udelay@PLT
	sub	ebx, 1
	je	.L27
.L3:
	mov	rdi, QWORD PTR SIS_AC97_STATUS[rip]
	add	rdi, rbp
	call	inw@PLT
	test	r12d, eax
	je	.L6
	test	DWORD PTR SIS_AC97_STATUS_BUSY[rip], eax
	jne	.L6
	mov	rsi, QWORD PTR SIS_AC97_CMD[rip]
	mov	edi, DWORD PTR 12[rsp]
	mov	ebx, 65535
	add	rsi, rbp
	call	outl@PLT
	mov	edi, 10
	call	udelay@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	sub	ebx, 1
	je	.L28
	mov	edi, 1
	call	udelay@PLT
.L13:
	mov	rdi, QWORD PTR SIS_AC97_STATUS[rip]
	add	rdi, rbp
	call	inw@PLT
	test	DWORD PTR SIS_AC97_STATUS_BUSY[rip], eax
	jne	.L29
	mov	rdi, QWORD PTR SIS_AC97_CMD[rip]
	add	rdi, rbp
	call	inl@PLT
	mov	rsi, QWORD PTR SIS_AC97_SEMA[rip]
	mov	edi, DWORD PTR SIS_AC97_SEMA_RELEASE[rip]
	shr	eax, 16
	add	rsi, rbp
	mov	r12d, eax
	call	outl@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	mov	rdi, r15
	mov	r12d, -1
	call	mutex_unlock@PLT
.L12:
	mov	rdi, QWORD PTR 8[r13]
	mov	ecx, DWORD PTR 12[rsp]
	mov	edx, r14d
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	jmp	.L1
.L27:
	mov	rsi, QWORD PTR SIS_AC97_SEMA[rip]
	mov	edi, DWORD PTR SIS_AC97_SEMA_RELEASE[rip]
	mov	r12d, -1
	add	rsi, rbp
	call	outl@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	jmp	.L12
.L28:
	mov	rdi, QWORD PTR SIS_AC97_CMD[rip]
	add	rdi, rbp
	call	inl@PLT
	mov	rsi, QWORD PTR SIS_AC97_SEMA[rip]
	mov	edi, DWORD PTR SIS_AC97_SEMA_RELEASE[rip]
	shr	eax, 16
	add	rsi, rbp
	mov	r12d, eax
	call	outl@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	sis_ac97_rw, .-sis_ac97_rw
	.section	.rodata
	.align 8
	.type	codec_ready.1958, @object
	.size	codec_ready.1958, 12
codec_ready.1958:
	.long	128
	.long	130
	.long	129
	.comm	SIS_AC97_STATUS_BUSY,4,4
	.comm	SIS_AC97_STATUS,8,8
	.comm	SIS_AC97_SEMA_RELEASE,4,4
	.comm	SIS_AC97_SEMA_BUSY,4,4
	.comm	SIS_AC97_SEMA,8,8
	.comm	SIS_AC97_CMD,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sis7019.c_sis_ac97_rw.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ac97 codec %d timeout cmd 0x%08x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sis_ac97_rw, %function
sis_ac97_rw:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r0
	ldr	r5, [r10], #8
	sub	sp, sp, #12
	ldr	r3, .L31
	str	r0, [sp, #4]
	mov	r0, r10
	mov	fp, r1
	ldr	r8, [r3, r1, lsl #2]
	str	r2, [sp]
	ldr	r4, .L31+4
	bl	mutex_lock
	ldr	r9, .L31+8
	ldr	r6, .L31+12
	b	.L2
.L27:
	subs	r4, r4, #1
	beq	.L26
	mov	r0, #1
	bl	udelay
.L2:
	ldr	r0, [r9]
	add	r0, r5, r0
	bl	inw
	ldr	r3, [r6]
	tst	r0, r3
	bne	.L27
	ldr	r4, .L31+4
	ldr	r6, .L31+16
	ldr	r7, .L31+20
	b	.L3
.L6:
	mov	r0, #1
	bl	udelay
	subs	r4, r4, #1
	beq	.L28
.L3:
	ldr	r0, [r6]
	add	r0, r5, r0
	bl	inw
	tst	r8, r0
	beq	.L6
	ldr	r3, [r7]
	tst	r0, r3
	bne	.L6
	ldr	r8, .L31+24
	ldr	r0, [sp]
	ldr	r1, [r8]
	ldr	r4, .L31+4
	add	r1, r5, r1
	bl	outl
	mov	r0, #10
	bl	udelay
	b	.L13
.L30:
	subs	r4, r4, #1
	beq	.L29
	mov	r0, #1
	bl	udelay
.L13:
	ldr	r0, [r6]
	add	r0, r5, r0
	bl	inw
	ldr	r3, [r7]
	tst	r0, r3
	bne	.L30
	ldr	r0, [r8]
	add	r0, r5, r0
	bl	inl
	mov	r4, r0
	ldr	r3, .L31+28
	ldr	r1, [r9]
	ldr	r0, [r3]
	add	r1, r5, r1
	bl	outl
	lsr	r4, r4, #16
	mov	r0, r10
	bl	mutex_unlock
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	mov	r0, r10
	bl	mutex_unlock
	ldr	r4, .L31+4
.L12:
	ldr	r1, [sp, #4]
	mov	r2, fp
	ldr	r3, [sp]
	ldr	r0, [r1, #4]
	ldr	r1, .L31+32
	bl	dev_err
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	ldr	r3, .L31+28
	ldr	r1, [r9]
	ldr	r0, [r3]
	add	r1, r5, r1
	bl	outl
	mov	r0, r10
	bl	mutex_unlock
	ldr	r4, .L31+4
	b	.L12
.L29:
	ldr	r0, [r8]
	add	r0, r5, r0
	bl	inl
	mov	r4, r0
	ldr	r1, [r9]
	ldr	r3, .L31+28
	add	r1, r5, r1
	ldr	r0, [r3]
	bl	outl
	mov	r0, r10
	lsr	r4, r4, #16
	bl	mutex_unlock
	b	.L12
.L32:
	.align	2
.L31:
	.word	.LANCHOR0
	.word	65535
	.word	SIS_AC97_SEMA
	.word	SIS_AC97_SEMA_BUSY
	.word	SIS_AC97_STATUS
	.word	SIS_AC97_STATUS_BUSY
	.word	SIS_AC97_CMD
	.word	SIS_AC97_SEMA_RELEASE
	.word	.LC0
	.size	sis_ac97_rw, .-sis_ac97_rw
	.comm	SIS_AC97_STATUS_BUSY,4,4
	.comm	SIS_AC97_STATUS,4,4
	.comm	SIS_AC97_SEMA_RELEASE,4,4
	.comm	SIS_AC97_SEMA_BUSY,4,4
	.comm	SIS_AC97_SEMA,4,4
	.comm	SIS_AC97_CMD,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	codec_ready.4242, %object
	.size	codec_ready.4242, 12
codec_ready.4242:
	.word	128
	.word	130
	.word	129
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
