	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk3066_hdmi_setup
_rk3066_hdmi_setup:                     ## @rk3066_hdmi_setup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_drm_match_cea_mode
	movl	%eax, 8(%rbx)
	movq	_HDMI_COLORSPACE_RGB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rbx)
	cmpl	$22, %eax
	ja	LBB0_3
## %bb.1:
	movl	$6684876, %ecx                  ## imm = 0x6600CC
	btl	%eax, %ecx
	jae	LBB0_3
## %bb.2:
	movq	_HDMI_COLORIMETRY_ITU_601@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	imull	$1000, (%r14), %eax             ## imm = 0x3E8
	movl	%eax, (%rbx)
	movq	_HDMI_VIDEO_CTRL2@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_HDMI_VIDEO_AUDIO_DISABLE_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_HDMI_AUDIO_DISABLE@GOTPCREL(%rip), %r13
	movq	_HDMI_VIDEO_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r13), %ecx
	movq	%rbx, %rdi
	callq	_hdmi_modb
	movq	%rbx, %rdi
	callq	_rk3066_hdmi_get_power_mode
	movq	_HDMI_SYS_POWER_MODE_B@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%rsi, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_rk3066_hdmi_set_power_mode
LBB0_6:
	movq	_HDMI_AV_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HDMI_VIDEO_DE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_HDMI_VIDEO_EXTERNAL_DE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_hdmi_modb
	movq	_HDMI_VIDEO_CTRL1@GOTPCREL(%rip), %rax
	movq	_HDMI_VIDEO_OUTPUT_RGB444@GOTPCREL(%rip), %rcx
	movq	_HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_HDMI_VIDEO_INPUT_COLOR_RGB@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_hdmi_writeb
	movq	_HDMI_DEEP_COLOR_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$32, %edx
	callq	_hdmi_writeb
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rk3066_hdmi_config_video_timing
	cmpq	$0, 16(%rbx)
	movq	_HDMI_HDCP_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HDMI_VIDEO_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	je	LBB0_8
## %bb.7:
	movq	_HDMI_VIDEO_MODE_HDMI@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_hdmi_modb
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rk3066_hdmi_config_avi
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_hdmi_modb
LBB0_9:
	movq	%rbx, %rdi
	callq	_rk3066_hdmi_config_phy
	movq	_HDMI_SYS_POWER_MODE_E@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_rk3066_hdmi_set_power_mode
	movq	%rbx, %rdi
	callq	_rk3066_hdmi_i2c_init
	movl	(%r15), %esi
	movl	(%r12), %edx
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	callq	_hdmi_modb
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_HDMI_COLORIMETRY_ITU_709@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_COLORSPACE_RGB,4,2        ## @HDMI_COLORSPACE_RGB
	.comm	_HDMI_COLORIMETRY_ITU_601,4,2   ## @HDMI_COLORIMETRY_ITU_601
	.comm	_HDMI_COLORIMETRY_ITU_709,4,2   ## @HDMI_COLORIMETRY_ITU_709
	.comm	_HDMI_VIDEO_CTRL2,4,2           ## @HDMI_VIDEO_CTRL2
	.comm	_HDMI_VIDEO_AUDIO_DISABLE_MASK,4,2 ## @HDMI_VIDEO_AUDIO_DISABLE_MASK
	.comm	_HDMI_AUDIO_DISABLE,4,2         ## @HDMI_AUDIO_DISABLE
	.comm	_HDMI_VIDEO_DISABLE,4,2         ## @HDMI_VIDEO_DISABLE
	.comm	_HDMI_SYS_POWER_MODE_B,8,3      ## @HDMI_SYS_POWER_MODE_B
	.comm	_HDMI_AV_CTRL1,4,2              ## @HDMI_AV_CTRL1
	.comm	_HDMI_VIDEO_DE_MASK,4,2         ## @HDMI_VIDEO_DE_MASK
	.comm	_HDMI_VIDEO_EXTERNAL_DE,4,2     ## @HDMI_VIDEO_EXTERNAL_DE
	.comm	_HDMI_VIDEO_CTRL1,4,2           ## @HDMI_VIDEO_CTRL1
	.comm	_HDMI_VIDEO_OUTPUT_RGB444,4,2   ## @HDMI_VIDEO_OUTPUT_RGB444
	.comm	_HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT,4,2 ## @HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT
	.comm	_HDMI_VIDEO_INPUT_COLOR_RGB,4,2 ## @HDMI_VIDEO_INPUT_COLOR_RGB
	.comm	_HDMI_DEEP_COLOR_MODE,4,2       ## @HDMI_DEEP_COLOR_MODE
	.comm	_HDMI_HDCP_CTRL,4,2             ## @HDMI_HDCP_CTRL
	.comm	_HDMI_VIDEO_MODE_MASK,4,2       ## @HDMI_VIDEO_MODE_MASK
	.comm	_HDMI_VIDEO_MODE_HDMI,4,2       ## @HDMI_VIDEO_MODE_HDMI
	.comm	_HDMI_SYS_POWER_MODE_E,8,3      ## @HDMI_SYS_POWER_MODE_E
	.no_dead_strip	_rk3066_hdmi_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk3066_hdmi_setup
_rk3066_hdmi_setup:                     ; @rk3066_hdmi_setup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_drm_match_cea_mode
	str	w0, [x19, #8]
Lloh0:
	adrp	x8, _HDMI_COLORSPACE_RGB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDMI_COLORSPACE_RGB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #28]
	cmp	w0, #22
	b.hi	LBB0_9
; %bb.1:
	mov	w8, #1
	lsl	w8, w8, w0
	mov	w9, #204
	movk	w9, #102, lsl #16
	tst	w8, w9
	b.eq	LBB0_9
; %bb.2:
Lloh3:
	adrp	x8, _HDMI_COLORIMETRY_ITU_601@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDMI_COLORIMETRY_ITU_601@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	ldr	w8, [x20]
	mov	w9, #1000
	mul	w8, w8, w9
Lloh5:
	adrp	x21, _HDMI_VIDEO_CTRL2@GOTPAGE
Lloh6:
	ldr	x21, [x21, _HDMI_VIDEO_CTRL2@GOTPAGEOFF]
	str	w8, [x19]
	ldr	w1, [x21]
Lloh7:
	adrp	x22, _HDMI_VIDEO_AUDIO_DISABLE_MASK@GOTPAGE
Lloh8:
	ldr	x22, [x22, _HDMI_VIDEO_AUDIO_DISABLE_MASK@GOTPAGEOFF]
Lloh9:
	adrp	x23, _HDMI_AUDIO_DISABLE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _HDMI_AUDIO_DISABLE@GOTPAGEOFF]
	ldr	w2, [x22]
	ldr	w8, [x23]
Lloh11:
	adrp	x9, _HDMI_VIDEO_DISABLE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HDMI_VIDEO_DISABLE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	bl	_hdmi_modb
	mov	x0, x19
	bl	_rk3066_hdmi_get_power_mode
Lloh14:
	adrp	x8, _HDMI_SYS_POWER_MODE_B@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HDMI_SYS_POWER_MODE_B@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
	cmp	x0, x1
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_rk3066_hdmi_set_power_mode
LBB0_5:
Lloh17:
	adrp	x8, _HDMI_AV_CTRL1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HDMI_AV_CTRL1@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _HDMI_VIDEO_DE_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HDMI_VIDEO_DE_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _HDMI_VIDEO_EXTERNAL_DE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HDMI_VIDEO_EXTERNAL_DE@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_hdmi_modb
Lloh26:
	adrp	x8, _HDMI_VIDEO_CTRL1@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HDMI_VIDEO_CTRL1@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _HDMI_VIDEO_OUTPUT_RGB444@GOTPAGE
Lloh30:
	ldr	x8, [x8, _HDMI_VIDEO_OUTPUT_RGB444@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh35:
	adrp	x9, _HDMI_VIDEO_INPUT_COLOR_RGB@GOTPAGE
Lloh36:
	ldr	x9, [x9, _HDMI_VIDEO_INPUT_COLOR_RGB@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_hdmi_writeb
Lloh38:
	adrp	x8, _HDMI_DEEP_COLOR_MODE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _HDMI_DEEP_COLOR_MODE@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32
	bl	_hdmi_writeb
	mov	x0, x19
	mov	x1, x20
	bl	_rk3066_hdmi_config_video_timing
	ldr	x8, [x19, #16]
Lloh41:
	adrp	x9, _HDMI_HDCP_CTRL@GOTPAGE
Lloh42:
	ldr	x9, [x9, _HDMI_HDCP_CTRL@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x9]
Lloh44:
	adrp	x9, _HDMI_VIDEO_MODE_MASK@GOTPAGE
Lloh45:
	ldr	x9, [x9, _HDMI_VIDEO_MODE_MASK@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x9]
	cbz	x8, LBB0_7
; %bb.6:
Lloh47:
	adrp	x8, _HDMI_VIDEO_MODE_HDMI@GOTPAGE
Lloh48:
	ldr	x8, [x8, _HDMI_VIDEO_MODE_HDMI@GOTPAGEOFF]
Lloh49:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_hdmi_modb
	mov	x0, x19
	mov	x1, x20
	bl	_rk3066_hdmi_config_avi
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	w3, #0
	bl	_hdmi_modb
LBB0_8:
	mov	x0, x19
	bl	_rk3066_hdmi_config_phy
Lloh50:
	adrp	x8, _HDMI_SYS_POWER_MODE_E@GOTPAGE
Lloh51:
	ldr	x8, [x8, _HDMI_SYS_POWER_MODE_E@GOTPAGEOFF]
Lloh52:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_rk3066_hdmi_set_power_mode
	mov	x0, x19
	bl	_rk3066_hdmi_i2c_init
	ldr	w1, [x21]
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	x0, x19
	bl	_hdmi_modb
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh53:
	adrp	x8, _HDMI_COLORIMETRY_ITU_709@GOTPAGE
Lloh54:
	ldr	x8, [x8, _HDMI_COLORIMETRY_ITU_709@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_COLORSPACE_RGB,4,2        ; @HDMI_COLORSPACE_RGB
	.comm	_HDMI_COLORIMETRY_ITU_601,4,2   ; @HDMI_COLORIMETRY_ITU_601
	.comm	_HDMI_COLORIMETRY_ITU_709,4,2   ; @HDMI_COLORIMETRY_ITU_709
	.comm	_HDMI_VIDEO_CTRL2,4,2           ; @HDMI_VIDEO_CTRL2
	.comm	_HDMI_VIDEO_AUDIO_DISABLE_MASK,4,2 ; @HDMI_VIDEO_AUDIO_DISABLE_MASK
	.comm	_HDMI_AUDIO_DISABLE,4,2         ; @HDMI_AUDIO_DISABLE
	.comm	_HDMI_VIDEO_DISABLE,4,2         ; @HDMI_VIDEO_DISABLE
	.comm	_HDMI_SYS_POWER_MODE_B,8,3      ; @HDMI_SYS_POWER_MODE_B
	.comm	_HDMI_AV_CTRL1,4,2              ; @HDMI_AV_CTRL1
	.comm	_HDMI_VIDEO_DE_MASK,4,2         ; @HDMI_VIDEO_DE_MASK
	.comm	_HDMI_VIDEO_EXTERNAL_DE,4,2     ; @HDMI_VIDEO_EXTERNAL_DE
	.comm	_HDMI_VIDEO_CTRL1,4,2           ; @HDMI_VIDEO_CTRL1
	.comm	_HDMI_VIDEO_OUTPUT_RGB444,4,2   ; @HDMI_VIDEO_OUTPUT_RGB444
	.comm	_HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT,4,2 ; @HDMI_VIDEO_INPUT_DATA_DEPTH_8BIT
	.comm	_HDMI_VIDEO_INPUT_COLOR_RGB,4,2 ; @HDMI_VIDEO_INPUT_COLOR_RGB
	.comm	_HDMI_DEEP_COLOR_MODE,4,2       ; @HDMI_DEEP_COLOR_MODE
	.comm	_HDMI_HDCP_CTRL,4,2             ; @HDMI_HDCP_CTRL
	.comm	_HDMI_VIDEO_MODE_MASK,4,2       ; @HDMI_VIDEO_MODE_MASK
	.comm	_HDMI_VIDEO_MODE_HDMI,4,2       ; @HDMI_VIDEO_MODE_HDMI
	.comm	_HDMI_SYS_POWER_MODE_E,8,3      ; @HDMI_SYS_POWER_MODE_E
	.no_dead_strip	_rk3066_hdmi_setup
.subsections_via_symbols
