	.file	"extr_i2c-st.c_st_i2c_wait_free_bus.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"bus not free (status = 0x%08x)\n"
	.align 8
.LC1:
	.string	"Failed to recover the bus (%d)\n"
	.text
	.p2align 4
	.type	st_i2c_wait_free_bus, @function
st_i2c_wait_free_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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, 10
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, QWORD PTR SSC_STA[rip]
	add	rdi, QWORD PTR 8[rbp]
	call	readl_relaxed@PLT
	mov	r12d, eax
	mov	r13d, eax
	and	r13d, DWORD PTR SSC_STA_BUSY[rip]
	je	.L1
	mov	esi, 4000
	mov	edi, 2000
	call	usleep_range@PLT
	sub	ebx, 1
	jne	.L3
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, r12d
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	lea	rdi, 4[rbp]
	call	i2c_recover_bus@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L11
	mov	r13d, DWORD PTR EBUSY[rip]
	neg	r13d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L11:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	lea	rsi, .LC1[rip]
	call	dev_err@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
	.cfi_endproc
.LFE0:
	.size	st_i2c_wait_free_bus, .-st_i2c_wait_free_bus
	.comm	SSC_STA_BUSY,4,4
	.comm	SSC_STA,8,8
	.comm	EBUSY,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-st.c_st_i2c_wait_free_bus.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"bus not free (status = 0x%08x)\012\000"
	.align	2
.LC1:
	.ascii	"Failed to recover the bus (%d)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	st_i2c_wait_free_bus, %function
st_i2c_wait_free_bus:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, #10
	mov	r7, r0
	ldr	r9, .L12
	ldr	r8, .L12+4
.L3:
	ldr	r0, [r7, #8]
	ldr	r3, [r9]
	add	r0, r0, r3
	bl	readl_relaxed
	ldr	r2, [r8]
	mov	r4, r0
	ands	r5, r0, r2
	beq	.L1
	mov	r1, #4000
	mov	r0, #2000
	bl	usleep_range
	subs	r6, r6, #1
	bne	.L3
	mov	r5, r7
	ldr	r0, [r5], #4
	mov	r2, r4
	ldr	r1, .L12+8
	bl	dev_err
	mov	r0, r5
	bl	i2c_recover_bus
	subs	r5, r0, #0
	bne	.L11
	ldr	r3, .L12+12
	ldr	r2, [r3]
	rsb	r5, r2, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	mov	r2, r5
	ldr	r0, [r7]
	ldr	r1, .L12+16
	bl	dev_err
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	.align	2
.L12:
	.word	SSC_STA
	.word	SSC_STA_BUSY
	.word	.LC0
	.word	EBUSY
	.word	.LC1
	.size	st_i2c_wait_free_bus, .-st_i2c_wait_free_bus
	.comm	SSC_STA_BUSY,4,4
	.comm	SSC_STA,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
