	.file	"extr_imx7-media-csi.c_imx7_csi_link_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"link setup %s -> %s\n"
	.text
	.p2align 4
	.type	imx7_csi_link_setup, @function
imx7_csi_link_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	media_entity_to_v4l2_subdev@PLT
	mov	rdi, rax
	call	v4l2_get_subdevdata@PLT
	mov	rdx, QWORD PTR 8[rbx]
	lea	rsi, .LC0[rip]
	mov	rbp, rax
	mov	rax, QWORD PTR 8[r12]
	mov	ecx, DWORD PTR [rdx]
	mov	edi, DWORD PTR 28[rbp]
	mov	edx, DWORD PTR [rax]
	call	dev_dbg@PLT
	mov	rdi, rbp
	call	mutex_lock@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR MEDIA_PAD_FL_SINK[rip], eax
	jne	.L17
	test	DWORD PTR MEDIA_LNK_FL_ENABLED[rip], r13d
	je	.L9
	cmp	QWORD PTR 16[rbp], 0
	je	.L10
.L14:
	mov	r12d, DWORD PTR EBUSY[rip]
	neg	r12d
.L4:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L9:
	.cfi_restore_state
	lea	r12, 24[rbp]
	mov	rdi, r12
	call	v4l2_ctrl_handler_free@PLT
	xor	esi, esi
	mov	rdi, r12
	call	v4l2_ctrl_handler_init@PLT
	mov	QWORD PTR 16[rbp], 0
.L11:
	cmp	QWORD PTR 8[rbp], 0
	je	.L8
.L12:
	mov	rdi, rbp
	call	imx7_csi_init@PLT
	mov	r12d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdi, QWORD PTR 8[r12]
	call	is_media_entity_v4l2_subdev@PLT
	test	eax, eax
	jne	.L3
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR 8[r12]
	mov	QWORD PTR 16[rbp], rax
.L7:
	test	rax, rax
	je	.L11
	mov	rdi, rbp
	call	imx7_csi_init@PLT
	mov	r12d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, QWORD PTR 8[r12]
	call	media_entity_to_v4l2_subdev@PLT
	test	DWORD PTR MEDIA_LNK_FL_ENABLED[rip], r13d
	je	.L5
	cmp	QWORD PTR 8[rbp], 0
	jne	.L14
	mov	QWORD PTR 8[rbp], rax
	mov	rax, QWORD PTR 16[rbp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	QWORD PTR 16[rbp], 0
	mov	QWORD PTR 8[rbp], 0
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, rbp
	xor	r12d, r12d
	call	imx7_csi_deinit@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	imx7_csi_link_setup, .-imx7_csi_link_setup
	.comm	MEDIA_PAD_FL_SINK,4,4
	.comm	MEDIA_LNK_FL_ENABLED,4,4
	.comm	EINVAL,4,4
	.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_imx7-media-csi.c_imx7_csi_link_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"link setup %s -> %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	imx7_csi_link_setup, %function
imx7_csi_link_setup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r1
	mov	r7, r2
	mov	r5, r3
	bl	media_entity_to_v4l2_subdev
	bl	v4l2_get_subdevdata
	mov	r4, r0
	ldr	r3, [r6, #4]
	ldr	r2, [r7, #4]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L21
	ldr	r0, [r0, #16]
	bl	dev_dbg
	mov	r0, r4
	bl	mutex_lock
	ldr	r3, .L21+4
	ldr	r2, [r6]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L20
	ldr	r3, .L21+8
	ldr	r1, [r3]
	ands	r5, r5, r1
	beq	.L9
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L10
.L17:
	ldr	r3, .L21+12
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L4:
	mov	r0, r4
	bl	mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	add	r6, r4, #12
	mov	r0, r6
	bl	v4l2_ctrl_handler_free
	mov	r1, r5
	mov	r0, r6
	bl	v4l2_ctrl_handler_init
	str	r5, [r4, #8]
.L11:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L8
.L12:
	mov	r0, r4
	bl	imx7_csi_init
	mov	r5, r0
	b	.L4
.L20:
	ldr	r0, [r7, #4]
	bl	is_media_entity_v4l2_subdev
	cmp	r0, #0
	bne	.L3
	ldr	r3, .L21+16
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L4
.L10:
	ldr	r3, [r7, #4]
	str	r3, [r4, #8]
.L7:
	cmp	r3, #0
	beq	.L11
	mov	r0, r4
	bl	imx7_csi_init
	mov	r5, r0
	b	.L4
.L3:
	ldr	r0, [r7, #4]
	bl	media_entity_to_v4l2_subdev
	ldr	r3, .L21+8
	ldr	r3, [r3]
	ands	r3, r5, r3
	beq	.L5
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L17
	ldr	r3, [r4, #8]
	str	r0, [r4, #4]
	b	.L7
.L5:
	ldr	r2, [r4, #8]
	str	r3, [r4, #4]
	cmp	r2, #0
	bne	.L12
.L8:
	mov	r0, r4
	bl	imx7_csi_deinit
	mov	r5, #0
	b	.L4
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	MEDIA_PAD_FL_SINK
	.word	MEDIA_LNK_FL_ENABLED
	.word	EBUSY
	.word	EINVAL
	.size	imx7_csi_link_setup, .-imx7_csi_link_setup
	.comm	MEDIA_PAD_FL_SINK,4,4
	.comm	MEDIA_LNK_FL_ENABLED,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
