	.file	"extr_rk3066_hdmi.c_rk3066_hdmi_set_power_mode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"mode         :%d\n"
.LC1:
	.string	"current_mode :%d\n"
.LC2:
	.string	"%d: next_mode :%d\n"
	.text
	.p2align 4
	.type	rk3066_hdmi_set_power_mode, @function
rk3066_hdmi_set_power_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	rk3066_hdmi_get_power_mode@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	edx, r13d
	lea	rsi, .LC0[rip]
	mov	ebx, eax
	xor	eax, eax
	call	DRM_DEV_DEBUG@PLT
	mov	edi, DWORD PTR 4[r12]
	xor	eax, eax
	mov	edx, ebx
	lea	rsi, .LC1[rip]
	call	DRM_DEV_DEBUG@PLT
	cmp	ebx, r13d
	je	.L1
	xor	ebp, ebp
	lea	r14, .LC2[rip]
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L20:
	mov	eax, ebx
	shr	eax, 31
	add	ebx, eax
	sar	ebx
.L5:
	mov	edi, DWORD PTR 4[r12]
	xor	eax, eax
	mov	ecx, ebx
	mov	edx, ebp
	mov	rsi, r14
	call	DRM_DEV_DEBUG@PLT
	cmp	DWORD PTR HDMI_SYS_POWER_MODE_D[rip], ebx
	je	.L6
	mov	edx, DWORD PTR HDMI_SYS_POWER_MODE_MASK[rip]
	mov	ecx, ebx
	mov	rdi, r12
	add	ebp, 1
	mov	esi, DWORD PTR HDMI_SYS_CTRL[rip]
	call	hdmi_modb@PLT
	cmp	ebx, r13d
	je	.L12
.L21:
	cmp	ebp, 4
	jg	.L12
.L2:
	cmp	ebx, r13d
	jg	.L20
	mov	eax, DWORD PTR HDMI_SYS_POWER_MODE_A[rip]
	lea	edx, [rbx+rbx]
	cmp	eax, ebx
	cmovle	eax, edx
	mov	ebx, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edx, DWORD PTR HDMI_SYS_PLL_RESET_MASK[rip]
	mov	esi, DWORD PTR HDMI_SYS_CTRL[rip]
	mov	rdi, r12
	add	ebp, 1
	or	edx, ebx
	call	hdmi_writeb@PLT
	mov	esi, 100
	mov	edi, 90
	call	usleep_range@PLT
	mov	esi, DWORD PTR HDMI_SYS_CTRL[rip]
	mov	edx, DWORD PTR HDMI_SYS_POWER_MODE_D[rip]
	mov	rdi, r12
	or	edx, DWORD PTR HDMI_SYS_PLLB_RESET[rip]
	call	hdmi_writeb@PLT
	mov	esi, 100
	mov	edi, 90
	call	usleep_range@PLT
	mov	edx, DWORD PTR HDMI_SYS_POWER_MODE_D[rip]
	mov	esi, DWORD PTR HDMI_SYS_CTRL[rip]
	mov	rdi, r12
	call	hdmi_writeb@PLT
	cmp	ebx, r13d
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L12:
	cmp	DWORD PTR HDMI_SYS_POWER_MODE_D[rip], r13d
	jle	.L1
	mov	eax, DWORD PTR DEFAULT_PLLA_RATE[rip]
	mov	DWORD PTR [r12], eax
.L1:
	pop	rbx
	.cfi_def_cfa_offset 40
	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
	.cfi_endproc
.LFE0:
	.size	rk3066_hdmi_set_power_mode, .-rk3066_hdmi_set_power_mode
	.comm	HDMI_SYS_POWER_MODE_MASK,4,4
	.comm	HDMI_SYS_POWER_MODE_D,4,4
	.comm	HDMI_SYS_POWER_MODE_A,4,4
	.comm	HDMI_SYS_PLL_RESET_MASK,4,4
	.comm	HDMI_SYS_PLLB_RESET,4,4
	.comm	HDMI_SYS_CTRL,4,4
	.comm	DEFAULT_PLLA_RATE,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_rk3066_hdmi.c_rk3066_hdmi_set_power_mode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"mode         :%d\012\000"
	.align	2
.LC1:
	.ascii	"current_mode :%d\012\000"
	.align	2
.LC2:
	.ascii	"%d: next_mode :%d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rk3066_hdmi_set_power_mode, %function
rk3066_hdmi_set_power_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r1
	mov	r5, r0
	bl	rk3066_hdmi_get_power_mode
	mov	r10, r0
	mov	r2, r6
	ldr	r1, .L16
	ldr	r0, [r5, #4]
	bl	DRM_DEV_DEBUG
	mov	r2, r10
	ldr	r0, [r5, #4]
	ldr	r1, .L16+4
	bl	DRM_DEV_DEBUG
	cmp	r10, r6
	popeq	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
	mov	r4, #0
	ldr	r7, .L16+8
	ldr	r8, .L16+12
	ldr	r9, .L16+16
	ldr	fp, .L16+20
	b	.L2
.L15:
	ldr	r2, .L16+24
	mov	r3, r10
	mov	r0, r5
	ldr	r2, [r2]
	ldr	r1, [r8]
	bl	hdmi_modb
.L7:
	subs	r3, r10, r6
	add	r4, r4, #1
	movne	r3, #1
	cmp	r4, #4
	movgt	r3, #0
	cmp	r3, #0
	beq	.L14
.L2:
	cmp	r10, r6
	add	r3, r10, r10, lsr #31
	asrgt	r10, r3, #1
	bgt	.L5
	ldr	r3, .L16+28
	ldr	r3, [r3]
	cmp	r3, r10
	movgt	r10, r3
	lslle	r10, r10, #1
.L5:
	mov	r3, r10
	mov	r2, r4
	mov	r1, r9
	ldr	r0, [r5, #4]
	bl	DRM_DEV_DEBUG
	ldr	r3, [r7]
	cmp	r3, r10
	bne	.L15
	ldr	r2, [fp]
	ldr	r1, [r8]
	orr	r2, r10, r2
	mov	r0, r5
	bl	hdmi_writeb
	mov	r1, #100
	mov	r0, #90
	bl	usleep_range
	ldr	r3, .L16+32
	ldr	r2, [r7]
	ldr	r3, [r3]
	ldr	r1, [r8]
	orr	r2, r2, r3
	mov	r0, r5
	bl	hdmi_writeb
	mov	r1, #100
	mov	r0, #90
	bl	usleep_range
	mov	r0, r5
	ldr	r2, [r7]
	ldr	r1, [r8]
	bl	hdmi_writeb
	b	.L7
.L14:
	ldr	r3, [r7]
	cmp	r3, r6
	ldrgt	r3, .L16+36
	ldrgt	r3, [r3]
	strgt	r3, [r5]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	.LC1
	.word	HDMI_SYS_POWER_MODE_D
	.word	HDMI_SYS_CTRL
	.word	.LC2
	.word	HDMI_SYS_PLL_RESET_MASK
	.word	HDMI_SYS_POWER_MODE_MASK
	.word	HDMI_SYS_POWER_MODE_A
	.word	HDMI_SYS_PLLB_RESET
	.word	DEFAULT_PLLA_RATE
	.size	rk3066_hdmi_set_power_mode, .-rk3066_hdmi_set_power_mode
	.comm	HDMI_SYS_POWER_MODE_MASK,4,4
	.comm	HDMI_SYS_POWER_MODE_D,4,4
	.comm	HDMI_SYS_POWER_MODE_A,4,4
	.comm	HDMI_SYS_PLL_RESET_MASK,4,4
	.comm	HDMI_SYS_PLLB_RESET,4,4
	.comm	HDMI_SYS_CTRL,4,4
	.comm	DEFAULT_PLLA_RATE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
