	.file	"extr_mt9p012_fox.c_mt9p012_sensor_open_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"mt9p012_init failed!\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"mt9p012_setting failed. rc = %d\n"
	.align 8
.LC2:
	.string	"mt9p012_sensor_open_init(): enabling output.\n"
	.align 8
.LC3:
	.string	"sensor output enable failed. rc = %d\n"
	.text
	.p2align 4
	.type	mt9p012_sensor_open_init, @function
mt9p012_sensor_open_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edi, 4
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	call	kzalloc@PLT
	mov	QWORD PTR mt9p012_ctrl[rip], rax
	test	rax, rax
	je	.L14
	movabs	rcx, 4398046512128
	mov	QWORD PTR [rax], rcx
	mov	edx, DWORD PTR TEST_OFF[rip]
	mov	DWORD PTR 28[rax], edx
	mov	rdx, QWORD PTR QTR_SIZE[rip]
	mov	QWORD PTR 8[rax], rdx
	mov	edx, DWORD PTR FULL_SIZE[rip]
	mov	DWORD PTR 24[rax], edx
	test	rbp, rbp
	je	.L4
	mov	QWORD PTR 16[rax], rbp
.L4:
	mov	edi, DWORD PTR MT9P012_DEFAULT_CLOCK_RATE[rip]
	call	msm_camio_clk_rate_set@PLT
	mov	edi, 20
	call	mdelay@PLT
	xor	eax, eax
	call	msm_camio_camif_pad_reg_reset@PLT
	mov	edi, 20
	call	mdelay@PLT
	mov	rdi, rbp
	call	mt9p012_probe_init_sensor@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L5
	mov	rax, QWORD PTR mt9p012_ctrl[rip]
	mov	edi, DWORD PTR REG_INIT[rip]
	mov	rcx, QWORD PTR QTR_SIZE[rip]
	cmp	QWORD PTR 8[rax], rcx
	je	.L15
	mov	esi, DWORD PTR RES_CAPTURE[rip]
	call	mt9p012_setting@PLT
	mov	r12d, eax
	test	r12d, r12d
	js	.L16
.L8:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	CDBG@PLT
	mov	rax, QWORD PTR mt9p012_client[rip]
	mov	edx, DWORD PTR MT9P012_RESET_REGISTER_PWON[rip]
	mov	esi, DWORD PTR MT9P012_REG_RESET_REGISTER[rip]
	mov	edi, DWORD PTR [rax]
	call	mt9p012_i2c_write_w@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L1
	mov	esi, eax
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	CDBG@PLT
.L5:
	mov	rdi, rbp
	call	mt9p012_probe_init_done@PLT
	mov	rdi, QWORD PTR mt9p012_ctrl[rip]
	call	kfree@PLT
.L3:
	endbr64
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	esi, DWORD PTR RES_PREVIEW[rip]
	call	mt9p012_setting@PLT
	mov	r12d, eax
	test	r12d, r12d
	jns	.L8
.L16:
	mov	esi, r12d
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	CDBG@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC0[rip]
	call	CDBG@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	mt9p012_sensor_open_init, .-mt9p012_sensor_open_init
	.comm	mt9p012_ctrl,8,8
	.comm	mt9p012_client,8,8
	.comm	TEST_OFF,4,4
	.comm	RES_PREVIEW,4,4
	.comm	RES_CAPTURE,4,4
	.comm	REG_INIT,4,4
	.comm	QTR_SIZE,8,8
	.comm	MT9P012_RESET_REGISTER_PWON,4,4
	.comm	MT9P012_REG_RESET_REGISTER,4,4
	.comm	MT9P012_DEFAULT_CLOCK_RATE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	FULL_SIZE,4,4
	.comm	ENOMEM,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_mt9p012_fox.c_mt9p012_sensor_open_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"mt9p012_init failed!\012\000"
	.align	2
.LC1:
	.ascii	"mt9p012_setting failed. rc = %d\012\000"
	.align	2
.LC2:
	.ascii	"mt9p012_sensor_open_init(): enabling output.\012\000"
	.align	2
.LC3:
	.ascii	"sensor output enable failed. rc = %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mt9p012_sensor_open_init, %function
mt9p012_sensor_open_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L16
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r1, [r3]
	mov	r5, r0
	mov	r0, #4
	bl	kzalloc
	ldr	r6, .L16+4
	cmp	r0, #0
	str	r0, [r6]
	beq	.L14
	mov	r3, #1024
	ldr	r2, .L16+8
	ldr	r7, .L16+12
	ldr	r2, [r2]
	ldr	r1, .L16+16
	str	r2, [r0, #20]
	ldr	r1, [r1]
	ldr	r2, [r7]
	str	r3, [r0, #4]
	str	r3, [r0]
	ldr	r3, .L16+20
	cmp	r5, #0
	strne	r5, [r0, #12]
	str	r1, [r0, #16]
	str	r2, [r0, #8]
	ldr	r0, [r3]
	bl	msm_camio_clk_rate_set
	mov	r0, #20
	bl	mdelay
	bl	msm_camio_camif_pad_reg_reset
	mov	r0, #20
	bl	mdelay
	mov	r0, r5
	bl	mt9p012_probe_init_sensor
	subs	r4, r0, #0
	blt	.L5
	ldr	r3, [r6]
	ldr	r2, [r7]
	ldr	r1, [r3, #8]
	ldr	r3, .L16+24
	cmp	r1, r2
	ldr	r0, [r3]
	ldreq	r3, .L16+28
	ldrne	r3, .L16+32
	ldr	r1, [r3]
	bl	mt9p012_setting
	cmp	r0, #0
	mov	r4, r0
	blt	.L15
	ldr	r0, .L16+36
	bl	CDBG
	ldr	r3, .L16+40
	ldr	r2, .L16+44
	ldr	r1, [r3]
	ldr	r3, .L16+48
	ldr	r0, [r1]
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	mt9p012_i2c_write_w
	subs	r4, r0, #0
	bge	.L1
	mov	r1, r4
	ldr	r0, .L16+52
	bl	CDBG
.L5:
	mov	r0, r5
	bl	mt9p012_probe_init_done
	ldr	r0, [r6]
	bl	kfree
.L3:
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L15:
	mov	r1, r0
	ldr	r0, .L16+56
	bl	CDBG
	b	.L5
.L14:
	ldr	r0, .L16+60
	bl	CDBG
	ldr	r3, .L16+64
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L17:
	.align	2
.L16:
	.word	GFP_KERNEL
	.word	mt9p012_ctrl
	.word	TEST_OFF
	.word	QTR_SIZE
	.word	FULL_SIZE
	.word	MT9P012_DEFAULT_CLOCK_RATE
	.word	REG_INIT
	.word	RES_PREVIEW
	.word	RES_CAPTURE
	.word	.LC2
	.word	mt9p012_client
	.word	MT9P012_RESET_REGISTER_PWON
	.word	MT9P012_REG_RESET_REGISTER
	.word	.LC3
	.word	.LC1
	.word	.LC0
	.word	ENOMEM
	.size	mt9p012_sensor_open_init, .-mt9p012_sensor_open_init
	.comm	mt9p012_ctrl,4,4
	.comm	mt9p012_client,4,4
	.comm	TEST_OFF,4,4
	.comm	RES_PREVIEW,4,4
	.comm	RES_CAPTURE,4,4
	.comm	REG_INIT,4,4
	.comm	QTR_SIZE,4,4
	.comm	MT9P012_RESET_REGISTER_PWON,4,4
	.comm	MT9P012_REG_RESET_REGISTER,4,4
	.comm	MT9P012_DEFAULT_CLOCK_RATE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	FULL_SIZE,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
