	.file	"extr_mxs-lradc-adc.c_mxs_lradc_adc_read_single.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mxs_lradc_adc_read_single, @function
mxs_lradc_adc_read_single:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	iio_priv@PLT
	mov	rdi, rbp
	mov	r15, QWORD PTR 16[rax]
	mov	rbx, rax
	call	iio_device_claim_direct_mode@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L11
.L1:
	add	rsp, 8
	.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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	lea	r12, 8[rbx]
	mov	rdi, r12
	call	reinit_completion@PLT
	mov	rax, QWORD PTR IMX28_LRADC[rip]
	cmp	QWORD PTR [r15], rax
	je	.L12
.L3:
	mov	rsi, QWORD PTR LRADC_CTRL0[rip]
	mov	edi, 1
	add	rsi, QWORD PTR [rbx]
	add	rsi, QWORD PTR STMP_OFFSET_REG_CLR[rip]
	call	writel@PLT
	lea	rsi, 12[rbx]
	mov	edi, r13d
	call	test_bit@PLT
	mov	rsi, QWORD PTR LRADC_CTRL2[rip]
	add	rsi, QWORD PTR [rbx]
	test	rax, rax
	je	.L4
	mov	ecx, DWORD PTR LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET[rip]
	mov	edi, 1
	add	rsi, QWORD PTR STMP_OFFSET_REG_SET[rip]
	sal	edi, cl
	call	writel@PLT
.L5:
	xor	edi, edi
	mov	r15, QWORD PTR LRADC_CTRL4[rip]
	add	r15, QWORD PTR [rbx]
	add	r15, QWORD PTR STMP_OFFSET_REG_CLR[rip]
	call	LRADC_CTRL4_LRADCSELECT_MASK@PLT
	mov	rsi, r15
	mov	edi, eax
	call	writel@PLT
	mov	edi, r13d
	mov	rsi, QWORD PTR LRADC_CTRL4[rip]
	add	rsi, QWORD PTR [rbx]
	add	rsi, QWORD PTR STMP_OFFSET_REG_SET[rip]
	call	writel@PLT
	mov	r13, QWORD PTR [rbx]
	xor	edi, edi
	call	LRADC_CH@PLT
	xor	edi, edi
	lea	rsi, 0[r13+rax]
	call	writel@PLT
	xor	edi, edi
	mov	r13, QWORD PTR LRADC_CTRL1[rip]
	add	r13, QWORD PTR [rbx]
	add	r13, QWORD PTR STMP_OFFSET_REG_SET[rip]
	call	LRADC_CTRL1_LRADC_IRQ_EN@PLT
	mov	rsi, r13
	mov	edi, eax
	call	writel@PLT
	xor	edi, edi
	mov	r13, QWORD PTR LRADC_CTRL0[rip]
	add	r13, QWORD PTR [rbx]
	add	r13, QWORD PTR STMP_OFFSET_REG_SET[rip]
	call	BIT@PLT
	mov	rsi, r13
	mov	edi, eax
	call	writel@PLT
	mov	esi, DWORD PTR HZ[rip]
	mov	rdi, r12
	call	wait_for_completion_killable_timeout@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L6
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	neg	r12d
.L6:
	mov	r13, QWORD PTR [rbx]
	test	r12d, r12d
	js	.L7
	xor	edi, edi
	call	LRADC_CH@PLT
	lea	rdi, [rax+r13]
	call	readl@PLT
	and	eax, DWORD PTR LRADC_CH_VALUE_MASK[rip]
	mov	r13, QWORD PTR [rbx]
	mov	DWORD PTR [r14], eax
	mov	r12d, DWORD PTR IIO_VAL_INT[rip]
.L7:
	xor	edi, edi
	add	r13, QWORD PTR LRADC_CTRL1[rip]
	add	r13, QWORD PTR STMP_OFFSET_REG_CLR[rip]
	call	LRADC_CTRL1_LRADC_IRQ_EN@PLT
	mov	rsi, r13
	mov	edi, eax
	call	writel@PLT
	mov	rdi, rbp
	call	iio_device_release_direct_mode@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	ecx, DWORD PTR LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET[rip]
	mov	edi, 1
	add	rsi, QWORD PTR STMP_OFFSET_REG_CLR[rip]
	sal	edi, cl
	call	writel@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	xor	edi, edi
	mov	r15, QWORD PTR LRADC_CTRL1[rip]
	add	r15, QWORD PTR [rbx]
	add	r15, QWORD PTR STMP_OFFSET_REG_CLR[rip]
	call	LRADC_CTRL1_LRADC_IRQ_EN@PLT
	mov	rsi, r15
	mov	edi, eax
	call	writel@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	mxs_lradc_adc_read_single, .-mxs_lradc_adc_read_single
	.comm	STMP_OFFSET_REG_SET,8,8
	.comm	STMP_OFFSET_REG_CLR,8,8
	.comm	LRADC_CTRL4,8,8
	.comm	LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,4,4
	.comm	LRADC_CTRL2,8,8
	.comm	LRADC_CTRL1,8,8
	.comm	LRADC_CTRL0,8,8
	.comm	LRADC_CH_VALUE_MASK,4,4
	.comm	IMX28_LRADC,8,8
	.comm	IIO_VAL_INT,4,4
	.comm	HZ,4,4
	.comm	ETIMEDOUT,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_mxs-lradc-adc.c_mxs_lradc_adc_read_single.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mxs_lradc_adc_read_single, %function
mxs_lradc_adc_read_single:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r7, r1
	mov	r6, r0
	str	r2, [sp, #4]
	bl	iio_priv
	mov	r4, r0
	mov	r0, r6
	ldr	r9, [r4, #12]
	bl	iio_device_claim_direct_mode
	subs	r5, r0, #0
	beq	.L12
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	add	fp, r4, #4
	mov	r0, fp
	bl	reinit_completion
	ldr	r3, .L13
	ldr	r2, [r9]
	ldr	r3, [r3]
	ldr	r10, .L13+4
	cmp	r2, r3
	beq	.L9
	ldr	r9, .L13+8
.L3:
	mov	r8, r4
	ldr	r5, .L13+12
	ldr	r2, [r8], #8
	ldr	r0, [r5]
	ldr	r1, [r9]
	add	r2, r2, r0
	add	r1, r2, r1
	mov	r0, #1
	bl	writel
	mov	r1, r8
	mov	r0, r7
	bl	test_bit
	cmp	r0, #0
	beq	.L4
	mov	ip, #1
	ldr	r2, .L13+16
	ldr	r8, .L13+20
	ldr	r1, [r2]
	ldr	r0, .L13+24
	ldr	r2, [r4]
	ldr	r0, [r0]
	add	r2, r2, r1
	ldr	r1, [r8]
	lsl	r0, ip, r0
	add	r1, r2, r1
	bl	writel
.L5:
	mov	r0, #0
	bl	LRADC_CTRL4_LRADCSELECT_MASK
	ldr	r2, .L13+28
	ldr	ip, [r4]
	ldr	r1, [r2]
	ldr	lr, [r9]
	add	r1, ip, r1
	add	r1, r1, lr
	bl	writel
	ldr	r2, .L13+28
	ldr	r1, [r8]
	ldr	r0, [r2]
	ldr	r2, [r4]
	add	r2, r2, r0
	add	r1, r2, r1
	mov	r0, r7
	bl	writel
	mov	r0, #0
	ldr	r7, [r4]
	bl	LRADC_CH
	mov	r1, r0
	mov	r0, #0
	add	r1, r7, r1
	bl	writel
	mov	r0, #0
	bl	LRADC_CTRL1_LRADC_IRQ_EN
	ldr	ip, [r10]
	ldr	r2, [r4]
	ldr	r1, [r8]
	add	r2, r2, ip
	add	r1, r2, r1
	bl	writel
	mov	r0, #0
	bl	BIT
	ldr	ip, [r5]
	ldr	r2, [r4]
	ldr	r1, [r8]
	add	r2, r2, ip
	add	r1, r2, r1
	bl	writel
	ldr	r3, .L13+32
	mov	r0, fp
	ldr	r1, [r3]
	bl	wait_for_completion_killable_timeout
	subs	r5, r0, #0
	ldreq	r3, .L13+36
	ldreq	r5, [r3]
	rsbeq	r5, r5, #0
	cmp	r5, #0
	blt	.L7
	mov	r0, #0
	ldr	r5, [r4]
	bl	LRADC_CH
	add	r0, r5, r0
	bl	readl
	ldr	r3, .L13+40
	ldr	r1, [sp, #4]
	ldr	r3, [r3]
	ldr	r2, .L13+44
	and	r3, r3, r0
	str	r3, [r1]
	ldr	r5, [r2]
.L7:
	mov	r0, #0
	bl	LRADC_CTRL1_LRADC_IRQ_EN
	ldr	r2, [r10]
	ldr	r3, [r4]
	ldr	r1, [r9]
	add	r3, r3, r2
	add	r1, r3, r1
	bl	writel
	mov	r0, r6
	bl	iio_device_release_direct_mode
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r0, #1
	ldr	r3, .L13+16
	ldr	r2, .L13+24
	ldr	r1, [r3]
	ldr	r3, [r4]
	ldr	r2, [r2]
	add	r3, r3, r1
	ldr	r1, [r9]
	lsl	r0, r0, r2
	add	r1, r3, r1
	bl	writel
	ldr	r8, .L13+20
	b	.L5
.L9:
	mov	r0, r5
	ldr	r9, .L13+8
	bl	LRADC_CTRL1_LRADC_IRQ_EN
	ldr	r2, [r10]
	ldr	r3, [r4]
	ldr	r1, [r9]
	add	r3, r3, r2
	add	r1, r3, r1
	bl	writel
	b	.L3
.L14:
	.align	2
.L13:
	.word	IMX28_LRADC
	.word	LRADC_CTRL1
	.word	STMP_OFFSET_REG_CLR
	.word	LRADC_CTRL0
	.word	LRADC_CTRL2
	.word	STMP_OFFSET_REG_SET
	.word	LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET
	.word	LRADC_CTRL4
	.word	HZ
	.word	ETIMEDOUT
	.word	LRADC_CH_VALUE_MASK
	.word	IIO_VAL_INT
	.size	mxs_lradc_adc_read_single, .-mxs_lradc_adc_read_single
	.comm	STMP_OFFSET_REG_SET,4,4
	.comm	STMP_OFFSET_REG_CLR,4,4
	.comm	LRADC_CTRL4,4,4
	.comm	LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,4,4
	.comm	LRADC_CTRL2,4,4
	.comm	LRADC_CTRL1,4,4
	.comm	LRADC_CTRL0,4,4
	.comm	LRADC_CH_VALUE_MASK,4,4
	.comm	IMX28_LRADC,4,4
	.comm	IIO_VAL_INT,4,4
	.comm	HZ,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
