	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_lvds_grf_config
_rockchip_lvds_grf_config:              ## @rockchip_lvds_grf_config
	.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
	callq	_encoder_to_lvds
	movq	%rax, %rbx
	movl	(%r14), %r15d
	movq	_DRM_MODE_FLAG_PHSYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DRM_MODE_FLAG_PCSYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	(%rbx), %rax
	movq	_DISPLAY_OUTPUT_RGB@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_4
## %bb.1:
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movl	(%rax), %edi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_IS_ERR
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	32(%rbx), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edi
	callq	_pinctrl_select_state
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_4:
	movq	_LVDS_CH0_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	8(%rbx), %eax
	movq	(%rbx), %rcx
	cmpq	(%r12), %rcx
	jne	LBB0_6
## %bb.5:
	movq	_LVDS_TTL_EN@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_6:
	movq	_DISPLAY_OUTPUT_DUAL_LVDS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_9
## %bb.7:
	movq	_LVDS_DUAL@GOTPCREL(%rip), %rcx
LBB0_8:
	movq	_LVDS_CH1_EN@GOTPCREL(%rip), %rdx
	orl	(%rcx), %eax
	orl	(%rdx), %eax
LBB0_9:
	xorl	%ecx, %ecx
	testl	%r15d, %r13d
	setne	%cl
	xorl	%edx, %edx
	testl	%r15d, %esi
	setne	%dl
	movl	4(%r14), %esi
	subl	8(%r14), %esi
	andl	$1, %esi
	negl	%esi
	movq	_LVDS_START_PHASE_RST_1@GOTPCREL(%rip), %rdi
	andl	(%rdi), %esi
	orl	%eax, %esi
	shll	$8, %ecx
	shll	$9, %edx
	orl	%ecx, %edx
	orl	%esi, %edx
	orl	$-65536, %edx                   ## imm = 0xFFFF0000
	movl	24(%rbx), %edi
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	12(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEV_ERROR                  ## TAILCALL
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ## @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_PCSYNC,4,2       ## @DRM_MODE_FLAG_PCSYNC
	.comm	_DISPLAY_OUTPUT_RGB,8,3         ## @DISPLAY_OUTPUT_RGB
	.comm	_LVDS_CH0_EN,4,2                ## @LVDS_CH0_EN
	.comm	_LVDS_TTL_EN,4,2                ## @LVDS_TTL_EN
	.comm	_LVDS_CH1_EN,4,2                ## @LVDS_CH1_EN
	.comm	_DISPLAY_OUTPUT_DUAL_LVDS,8,3   ## @DISPLAY_OUTPUT_DUAL_LVDS
	.comm	_LVDS_DUAL,4,2                  ## @LVDS_DUAL
	.comm	_LVDS_START_PHASE_RST_1,4,2     ## @LVDS_START_PHASE_RST_1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not write to GRF: %d\n"

	.no_dead_strip	_rockchip_lvds_grf_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_lvds_grf_config
_rockchip_lvds_grf_config:              ; @rockchip_lvds_grf_config
	.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
	bl	_encoder_to_lvds
	mov	x19, x0
	ldr	w21, [x20]
Lloh0:
	adrp	x8, _DRM_MODE_FLAG_PHSYNC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_FLAG_PHSYNC@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _DRM_MODE_FLAG_PCSYNC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRM_MODE_FLAG_PCSYNC@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	ldr	x8, [x0]
Lloh6:
	adrp	x22, _DISPLAY_OUTPUT_RGB@GOTPAGE
Lloh7:
	ldr	x22, [x22, _DISPLAY_OUTPUT_RGB@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	w0, [x8]
	bl	_IS_ERR
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #32]
	ldp	w1, w0, [x8]
	bl	_pinctrl_select_state
LBB0_4:
	and	w8, w23, w21
	and	w10, w24, w21
Lloh8:
	adrp	x9, _LVDS_CH0_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _LVDS_CH0_EN@GOTPAGEOFF]
	ldr	w11, [x19, #8]
Lloh10:
	ldr	w9, [x9]
	orr	w9, w9, w11
	ldr	x11, [x19]
	ldr	x12, [x22]
	cmp	x11, x12
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x11, _LVDS_TTL_EN@GOTPAGE
Lloh12:
	ldr	x11, [x11, _LVDS_TTL_EN@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x12, _DISPLAY_OUTPUT_DUAL_LVDS@GOTPAGE
Lloh14:
	ldr	x12, [x12, _DISPLAY_OUTPUT_DUAL_LVDS@GOTPAGEOFF]
Lloh15:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_9
; %bb.7:
Lloh16:
	adrp	x11, _LVDS_DUAL@GOTPAGE
Lloh17:
	ldr	x11, [x11, _LVDS_DUAL@GOTPAGEOFF]
LBB0_8:
	ldr	w11, [x11]
Lloh18:
	adrp	x12, _LVDS_CH1_EN@GOTPAGE
Lloh19:
	ldr	x12, [x12, _LVDS_CH1_EN@GOTPAGEOFF]
Lloh20:
	ldr	w12, [x12]
	orr	w9, w11, w9
	orr	w9, w9, w12
LBB0_9:
	cmp	w10, #0
	cset	w10, ne
	ldp	w11, w12, [x20, #4]
	sub	w11, w11, w12
	sbfx	w11, w11, #0, #1
Lloh21:
	adrp	x12, _LVDS_START_PHASE_RST_1@GOTPAGE
Lloh22:
	ldr	x12, [x12, _LVDS_START_PHASE_RST_1@GOTPAGEOFF]
Lloh23:
	ldr	w12, [x12]
	and	w11, w11, w12
	mov	w12, #-65024
	mov	w13, #-65536
	cmp	w8, #0
	csel	w8, w13, w12, eq
	bfi	w8, w10, #8, #1
	orr	w8, w8, w9
	orr	w2, w8, w11
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	bl	_regmap_write
	cbz	w0, LBB0_11
; %bb.10:
	mov	x2, x0
	ldr	w0, [x19, #12]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_DRM_DEV_ERROR
LBB0_11:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ; @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_PCSYNC,4,2       ; @DRM_MODE_FLAG_PCSYNC
	.comm	_DISPLAY_OUTPUT_RGB,8,3         ; @DISPLAY_OUTPUT_RGB
	.comm	_LVDS_CH0_EN,4,2                ; @LVDS_CH0_EN
	.comm	_LVDS_TTL_EN,4,2                ; @LVDS_TTL_EN
	.comm	_LVDS_CH1_EN,4,2                ; @LVDS_CH1_EN
	.comm	_DISPLAY_OUTPUT_DUAL_LVDS,8,3   ; @DISPLAY_OUTPUT_DUAL_LVDS
	.comm	_LVDS_DUAL,4,2                  ; @LVDS_DUAL
	.comm	_LVDS_START_PHASE_RST_1,4,2     ; @LVDS_START_PHASE_RST_1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not write to GRF: %d\n"

	.no_dead_strip	_rockchip_lvds_grf_config
.subsections_via_symbols
