	.file	"extr_cyapa_gen3.c_cyapa_gen3_do_calibrate.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Error reading dev status: %d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Trackpad device is busy, device state: 0x%02x\n"
	.align 8
.LC2:
	.string	"Failed to send calibrate command: %d\n"
	.section	.rodata.str1.1
.LC3:
	.string	"Calibration successful.\n"
	.section	.rodata.str1.8
	.align 8
.LC4:
	.string	"Failed to calibrate. Timeout.\n"
	.text
	.p2align 4
	.type	cyapa_gen3_do_calibrate, @function
cyapa_gen3_do_calibrate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	dev_get_drvdata@PLT
	mov	esi, DWORD PTR CYAPA_CMD_DEV_STATUS[rip]
	mov	rdi, rax
	mov	rbx, rax
	call	cyapa_read_byte@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L13
	mov	eax, DWORD PTR CYAPA_DEV_NORMAL[rip]
	mov	edx, eax
	and	edx, r12d
	cmp	eax, edx
	jne	.L15
	mov	edx, DWORD PTR OP_RECALIBRATION_MASK[rip]
	mov	esi, DWORD PTR CYAPA_CMD_SOFT_RESET[rip]
	mov	rdi, rbx
	call	cyapa_write_byte@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L16
	mov	edx, DWORD PTR HZ[rip]
	mov	eax, DWORD PTR jiffies[rip]
	lea	r13d, [rax+rdx*2]
	movsx	r13, r13d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR CYAPA_DEV_NORMAL[rip]
	and	r12d, eax
	cmp	eax, r12d
	je	.L17
	mov	rdi, r13
	call	time_is_after_jiffies@PLT
	test	rax, rax
	je	.L18
.L10:
	mov	edi, 100
	call	msleep@PLT
	mov	esi, DWORD PTR CYAPA_CMD_DEV_STATUS[rip]
	mov	rdi, rbx
	call	cyapa_read_byte@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L7
.L13:
	mov	edx, r12d
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	dev_err@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	dev_warn@PLT
	mov	r12d, DWORD PTR EAGAIN[rip]
	neg	r12d
.L5:
	test	r12d, r12d
	js	.L1
.L9:
	mov	r12d, r14d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	call	dev_dbg@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	call	dev_err@PLT
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	neg	r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edx, eax
	lea	rsi, .LC2[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	dev_err@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	cyapa_gen3_do_calibrate, .-cyapa_gen3_do_calibrate
	.comm	jiffies,4,4
	.comm	OP_RECALIBRATION_MASK,4,4
	.comm	HZ,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EAGAIN,4,4
	.comm	CYAPA_DEV_NORMAL,4,4
	.comm	CYAPA_CMD_SOFT_RESET,4,4
	.comm	CYAPA_CMD_DEV_STATUS,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_cyapa_gen3.c_cyapa_gen3_do_calibrate.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Error reading dev status: %d\012\000"
	.align	2
.LC1:
	.ascii	"Trackpad device is busy, device state: 0x%02x\012\000"
	.align	2
.LC2:
	.ascii	"Failed to send calibrate command: %d\012\000"
	.align	2
.LC3:
	.ascii	"Calibration successful.\012\000"
	.align	2
.LC4:
	.ascii	"Failed to calibrate. Timeout.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cyapa_gen3_do_calibrate, %function
cyapa_gen3_do_calibrate:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r3
	mov	r8, r0
	bl	dev_get_drvdata
	ldr	r7, .L19
	mov	r5, r0
	ldr	r1, [r7]
	bl	cyapa_read_byte
	subs	r4, r0, #0
	blt	.L13
	ldr	r9, .L19+4
	ldr	r3, [r9]
	bics	r3, r3, r4
	bne	.L15
	ldr	r3, .L19+8
	ldr	r2, .L19+12
	mov	r0, r5
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	cyapa_write_byte
	subs	r4, r0, #0
	blt	.L16
	ldr	r3, .L19+16
	ldr	r2, .L19+20
	ldr	r3, [r3]
	ldr	r10, [r2]
	add	r10, r10, r3, lsl #1
	b	.L10
.L7:
	ldr	r3, [r9]
	bics	r3, r3, r4
	beq	.L17
	mov	r0, r10
	bl	time_is_after_jiffies
	cmp	r0, #0
	beq	.L18
.L10:
	mov	r0, #100
	bl	msleep
	mov	r0, r5
	ldr	r1, [r7]
	bl	cyapa_read_byte
	subs	r4, r0, #0
	bge	.L7
.L13:
	mov	r0, r8
	mov	r2, r4
	ldr	r1, .L19+24
	bl	dev_err
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	mov	r2, r4
	mov	r0, r8
	ldr	r1, .L19+28
	bl	dev_warn
	ldr	r3, .L19+32
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L5:
	cmp	r4, #0
	blt	.L1
.L9:
	mov	r4, r6
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	mov	r0, r8
	ldr	r1, .L19+36
	bl	dev_dbg
	b	.L9
.L18:
	mov	r0, r8
	ldr	r1, .L19+40
	bl	dev_err
	ldr	r3, .L19+44
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L5
.L16:
	mov	r0, r8
	mov	r2, r4
	ldr	r1, .L19+48
	bl	dev_err
	b	.L1
.L20:
	.align	2
.L19:
	.word	CYAPA_CMD_DEV_STATUS
	.word	CYAPA_DEV_NORMAL
	.word	CYAPA_CMD_SOFT_RESET
	.word	OP_RECALIBRATION_MASK
	.word	HZ
	.word	jiffies
	.word	.LC0
	.word	.LC1
	.word	EAGAIN
	.word	.LC3
	.word	.LC4
	.word	ETIMEDOUT
	.word	.LC2
	.size	cyapa_gen3_do_calibrate, .-cyapa_gen3_do_calibrate
	.comm	jiffies,4,4
	.comm	OP_RECALIBRATION_MASK,4,4
	.comm	HZ,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EAGAIN,4,4
	.comm	CYAPA_DEV_NORMAL,4,4
	.comm	CYAPA_CMD_SOFT_RESET,4,4
	.comm	CYAPA_CMD_DEV_STATUS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
