	.file	"extr_i2c-aspeed.c_aspeed_i2c_recover_bus.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"SCL hung (state %x), attempting recovery\n"
	.align 8
.LC1:
	.string	"SDA hung (state %x), attempting recovery\n"
	.text
	.p2align 4
	.type	aspeed_i2c_recover_bus, @function
aspeed_i2c_recover_bus:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rsi, r12
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spin_lock_irqsave@PLT
	mov	rdi, QWORD PTR ASPEED_I2C_CMD_REG[rip]
	add	rdi, QWORD PTR 8[rbp]
	call	readl@PLT
	mov	edx, eax
	test	DWORD PTR ASPEED_I2CD_SDA_LINE_STS[rip], eax
	je	.L2
	test	DWORD PTR ASPEED_I2CD_SCL_LINE_STS[rip], eax
	je	.L19
.L6:
	xor	r12d, r12d
	mov	rdi, rbp
	mov	rsi, r12
	call	spin_unlock_irqrestore@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	edi, DWORD PTR 32[rbp]
	lea	rsi, .LC0[rip]
	lea	r13, 28[rbp]
	call	dev_dbg@PLT
	mov	rdi, r13
	call	reinit_completion@PLT
	mov	edi, DWORD PTR ASPEED_I2CD_M_STOP_CMD[rip]
	mov	rsi, QWORD PTR ASPEED_I2C_CMD_REG[rip]
	add	rsi, QWORD PTR 8[rbp]
	call	writel@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	mov	esi, DWORD PTR 24[rbp]
	mov	rdi, r13
	call	wait_for_completion_timeout@PLT
	mov	rsi, r12
	mov	rdi, rbp
	mov	rbx, rax
	call	spin_lock_irqsave@PLT
	test	rbx, rbx
	je	.L5
	cmp	QWORD PTR 16[rbp], 0
	je	.L20
.L5:
	xor	r12d, r12d
	mov	rdi, rbp
	mov	rsi, r12
	call	spin_unlock_irqrestore@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	aspeed_i2c_reset@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR 32[rbp]
	lea	rsi, .LC1[rip]
	lea	r13, 28[rbp]
	xor	r12d, r12d
	call	dev_dbg@PLT
	mov	rdi, r13
	call	reinit_completion@PLT
	mov	edi, DWORD PTR ASPEED_I2CD_BUS_RECOVER_CMD[rip]
	mov	rsi, QWORD PTR ASPEED_I2C_CMD_REG[rip]
	add	rsi, QWORD PTR 8[rbp]
	call	writel@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	mov	esi, DWORD PTR 24[rbp]
	mov	rdi, r13
	call	wait_for_completion_timeout@PLT
	mov	rsi, r12
	mov	rdi, rbp
	mov	rbx, rax
	call	spin_lock_irqsave@PLT
	test	rbx, rbx
	je	.L5
	cmp	QWORD PTR 16[rbp], 0
	jne	.L5
	mov	rdi, QWORD PTR ASPEED_I2C_CMD_REG[rip]
	add	rdi, QWORD PTR 8[rbp]
	call	readl@PLT
	test	DWORD PTR ASPEED_I2CD_SDA_LINE_STS[rip], eax
	jne	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, QWORD PTR ASPEED_I2C_CMD_REG[rip]
	add	rdi, QWORD PTR 8[rbp]
	call	readl@PLT
	test	DWORD PTR ASPEED_I2CD_SCL_LINE_STS[rip], eax
	jne	.L6
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	aspeed_i2c_recover_bus, .-aspeed_i2c_recover_bus
	.comm	ASPEED_I2C_CMD_REG,8,8
	.comm	ASPEED_I2CD_SDA_LINE_STS,4,4
	.comm	ASPEED_I2CD_SCL_LINE_STS,4,4
	.comm	ASPEED_I2CD_M_STOP_CMD,4,4
	.comm	ASPEED_I2CD_BUS_RECOVER_CMD,4,4
	.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_i2c-aspeed.c_aspeed_i2c_recover_bus.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"SCL hung (state %x), attempting recovery\012\000"
	.align	2
.LC1:
	.ascii	"SDA hung (state %x), attempting recovery\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aspeed_i2c_recover_bus, %function
aspeed_i2c_recover_bus:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r5, .L21
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r3, [r5]
	ldr	r0, [r4, #4]
	ldr	r6, .L21+4
	add	r0, r0, r3
	bl	readl
	ldr	r3, [r6]
	mov	r2, r0
	tst	r0, r3
	beq	.L2
	ldr	r8, .L21+8
	ldr	r3, [r8]
	tst	r0, r3
	beq	.L19
.L6:
	mov	r0, r4
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	mov	r7, #0
	ldr	r1, .L21+12
	add	r6, r4, #16
	ldr	r0, [r4, #20]
	bl	dev_dbg
	mov	r0, r6
	bl	reinit_completion
	ldr	r2, [r5]
	ldr	r3, .L21+16
	ldr	r1, [r4, #4]
	ldr	r0, [r3]
	add	r1, r1, r2
	bl	writel
	mov	r1, r7
	mov	r0, r4
	bl	spin_unlock_irqrestore
	mov	r0, r6
	ldr	r1, [r4, #12]
	bl	wait_for_completion_timeout
	mov	r6, r0
	mov	r1, r7
	mov	r0, r4
	bl	spin_lock_irqsave
	cmp	r6, r7
	beq	.L5
	ldr	r3, [r4, #8]
	cmp	r3, r7
	beq	.L20
.L5:
	mov	r0, r4
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	aspeed_i2c_reset
.L2:
	mov	r7, #0
	ldr	r1, .L21+20
	add	r8, r4, #16
	ldr	r0, [r4, #20]
	bl	dev_dbg
	mov	r0, r8
	bl	reinit_completion
	ldr	r2, [r5]
	ldr	r3, .L21+24
	ldr	r1, [r4, #4]
	ldr	r0, [r3]
	add	r1, r1, r2
	bl	writel
	mov	r1, r7
	mov	r0, r4
	bl	spin_unlock_irqrestore
	mov	r0, r8
	ldr	r1, [r4, #12]
	bl	wait_for_completion_timeout
	mov	r8, r0
	mov	r1, r7
	mov	r0, r4
	bl	spin_lock_irqsave
	cmp	r8, r7
	beq	.L5
	ldr	r3, [r4, #8]
	cmp	r3, r7
	bne	.L5
	ldr	r3, [r5]
	ldr	r0, [r4, #4]
	add	r0, r0, r3
	bl	readl
	ldr	r3, [r6]
	tst	r0, r3
	bne	.L6
	b	.L5
.L20:
	ldr	r3, [r5]
	ldr	r0, [r4, #4]
	add	r0, r0, r3
	bl	readl
	ldr	r3, [r8]
	tst	r0, r3
	bne	.L6
	b	.L5
.L22:
	.align	2
.L21:
	.word	ASPEED_I2C_CMD_REG
	.word	ASPEED_I2CD_SDA_LINE_STS
	.word	ASPEED_I2CD_SCL_LINE_STS
	.word	.LC0
	.word	ASPEED_I2CD_M_STOP_CMD
	.word	.LC1
	.word	ASPEED_I2CD_BUS_RECOVER_CMD
	.size	aspeed_i2c_recover_bus, .-aspeed_i2c_recover_bus
	.comm	ASPEED_I2C_CMD_REG,4,4
	.comm	ASPEED_I2CD_SDA_LINE_STS,4,4
	.comm	ASPEED_I2CD_SCL_LINE_STS,4,4
	.comm	ASPEED_I2CD_M_STOP_CMD,4,4
	.comm	ASPEED_I2CD_BUS_RECOVER_CMD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
