	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdfld_dsi_dpi_controller_init  ## -- Begin function mdfld_dsi_dpi_controller_init
	.p2align	4, 0x90
_mdfld_dsi_dpi_controller_init:         ## @mdfld_dsi_dpi_controller_init
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	24(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r14d
	movq	16(%rdi), %r12
	movl	%esi, %edi
	callq	_MIPI_DEVICE_READY_REG
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_REG_FLD_MOD
	movl	%r13d, %edi
	callq	_MIPI_CTRL_REG
	movl	%eax, %edi
	movl	$24, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_INTR_EN_REG
	movl	%eax, %edi
	movl	$-1, %esi
	callq	_REG_WRITE
	movq	_DSI_DPI_VIRT_CHANNEL_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	4(%r15), %ebx
	shll	%cl, %ebx
	movl	8(%r15), %esi
	orl	%r14d, %ebx
	cmpl	$24, %esi
	je	LBB0_5
## %bb.1:
	cmpl	$18, %esi
	je	LBB0_4
## %bb.2:
	cmpl	$16, %esi
	jne	LBB0_6
## %bb.3:
	movq	_DSI_DPI_COLOR_FORMAT_RGB565@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_7
LBB0_5:
	movq	_DSI_DPI_COLOR_FORMAT_RGB888@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_7
LBB0_4:
	movq	_DSI_DPI_COLOR_FORMAT_RGB666@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_7:
	movl	%r13d, %edi
	callq	_MIPI_DSI_FUNC_PRG_REG
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_HS_TX_TIMEOUT_REG
	movl	%eax, %edi
	movl	4(%r12), %eax
	imull	(%r12), %eax
	imull	8(%r15), %eax
	shll	$3, %r14d
	cltd
	idivl	%r14d
	movq	_DSI_HS_TX_TIMEOUT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_LP_RX_TIMEOUT_REG
	movq	_DSI_LP_RX_TIMEOUT_MASK@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_TURN_AROUND_TIMEOUT_REG
	movq	_DSI_TURN_AROUND_TIMEOUT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	$20, %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_DEVICE_RESET_TIMER_REG
	movq	_DSI_RESET_TIMER_MASK@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_DPI_RESOLUTION_REG
	movl	8(%r12), %esi
	shll	$16, %esi
	orl	12(%r12), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	(%r15), %edx
	movl	8(%r15), %ecx
	leaq	-72(%rbp), %rsi
	movq	%r12, %rdi
	callq	_mdfld_dsi_dpi_timing_calculation
	movl	%r13d, %edi
	callq	_MIPI_HSYNC_COUNT_REG
	movq	_DSI_DPI_TIMING_MASK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	andl	-72(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_HBP_COUNT_REG
	movl	(%rbx), %esi
	andl	-68(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_HFP_COUNT_REG
	movl	(%rbx), %esi
	andl	-64(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_HACTIVE_COUNT_REG
	movl	(%rbx), %esi
	andl	-60(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_VSYNC_COUNT_REG
	movl	(%rbx), %esi
	andl	-56(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_VBP_COUNT_REG
	movl	(%rbx), %esi
	andl	-52(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_VFP_COUNT_REG
	movl	(%rbx), %esi
	andl	-48(%rbp), %esi
	movl	%eax, %edi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_HIGH_LOW_SWITCH_COUNT_REG
	movl	%eax, %edi
	movl	$70, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_INIT_COUNT_REG
	movl	%eax, %edi
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_REG_WRITE
	movq	_DSI_DPI_COMPLETE_LAST_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	12(%r15), %ebx
	movl	%r13d, %edi
	callq	_MIPI_VIDEO_MODE_FORMAT_REG
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_EOT_DISABLE_REG
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_LP_BYTECLK_REG
	movl	%eax, %edi
	movl	$4, %esi
	callq	_REG_WRITE
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_mdfld_get_panel_type
	movq	_TC35876X@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	movl	$705454088, %eax                ## imm = 0x2A0C6008
	movl	$353121288, %ebx                ## imm = 0x150C3408
	cmovel	%eax, %ebx
	movl	%r13d, %edi
	callq	_MIPI_DPHY_PARAM_REG
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_REG_WRITE
	movl	%r13d, %edi
	callq	_MIPI_CLK_LANE_SWITCH_TIME_CNT_REG
	movl	%eax, %edi
	movl	$655380, %esi                   ## imm = 0xA0014
	callq	_REG_WRITE
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_mdfld_get_panel_type
	cmpq	(%r14), %rax
	jne	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_tc35876x_set_bridge_reset_state
LBB0_9:
	movl	%r13d, %edi
	callq	_MIPI_DEVICE_READY_REG
	movl	%eax, %edi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_REG_FLD_MOD
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSI_DPI_VIRT_CHANNEL_OFFSET,4,2 ## @DSI_DPI_VIRT_CHANNEL_OFFSET
	.comm	_DSI_DPI_COLOR_FORMAT_RGB565,4,2 ## @DSI_DPI_COLOR_FORMAT_RGB565
	.comm	_DSI_DPI_COLOR_FORMAT_RGB666,4,2 ## @DSI_DPI_COLOR_FORMAT_RGB666
	.comm	_DSI_DPI_COLOR_FORMAT_RGB888,4,2 ## @DSI_DPI_COLOR_FORMAT_RGB888
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported color format, bpp = %d\n"

	.comm	_DSI_HS_TX_TIMEOUT_MASK,4,2     ## @DSI_HS_TX_TIMEOUT_MASK
	.comm	_DSI_LP_RX_TIMEOUT_MASK,4,2     ## @DSI_LP_RX_TIMEOUT_MASK
	.comm	_DSI_TURN_AROUND_TIMEOUT_MASK,4,2 ## @DSI_TURN_AROUND_TIMEOUT_MASK
	.comm	_DSI_RESET_TIMER_MASK,4,2       ## @DSI_RESET_TIMER_MASK
	.comm	_DSI_DPI_TIMING_MASK,4,2        ## @DSI_DPI_TIMING_MASK
	.comm	_DSI_DPI_COMPLETE_LAST_LINE,4,2 ## @DSI_DPI_COMPLETE_LAST_LINE
	.comm	_TC35876X,8,3                   ## @TC35876X
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdfld_dsi_dpi_controller_init  ; -- Begin function mdfld_dsi_dpi_controller_init
	.p2align	2
_mdfld_dsi_dpi_controller_init:         ; @mdfld_dsi_dpi_controller_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x21, x0
	ldr	w24, [x0]
	ldp	x22, x20, [x0, #16]
	mov	x0, x1
	bl	_MIPI_DEVICE_READY_REG
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_REG_FLD_MOD
	mov	x0, x19
	bl	_MIPI_CTRL_REG
	mov	w1, #24
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_INTR_EN_REG
	mov	w1, #-1
	bl	_REG_WRITE
Lloh0:
	adrp	x8, _DSI_DPI_VIRT_CHANNEL_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DSI_DPI_VIRT_CHANNEL_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w1, [x21, #4]
	lsl	w8, w9, w8
	orr	w23, w8, w24
	cmp	w1, #24
	b.eq	LBB0_4
; %bb.1:
	cmp	w1, #18
	b.eq	LBB0_5
; %bb.2:
	cmp	w1, #16
	b.ne	LBB0_7
; %bb.3:
Lloh3:
	adrp	x8, _DSI_DPI_COLOR_FORMAT_RGB565@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DSI_DPI_COLOR_FORMAT_RGB565@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x8, _DSI_DPI_COLOR_FORMAT_RGB888@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DSI_DPI_COLOR_FORMAT_RGB888@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _DSI_DPI_COLOR_FORMAT_RGB666@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DSI_DPI_COLOR_FORMAT_RGB666@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	orr	w23, w8, w23
	b	LBB0_8
LBB0_7:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_8:
	mov	x0, x19
	bl	_MIPI_DSI_FUNC_PRG_REG
	mov	x1, x23
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_HS_TX_TIMEOUT_REG
	ldp	w8, w9, [x22]
	mul	w8, w9, w8
	ldr	w9, [x21, #8]
	mul	w8, w8, w9
	lsl	w9, w24, #3
	sdiv	w8, w8, w9
Lloh11:
	adrp	x9, _DSI_HS_TX_TIMEOUT_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DSI_HS_TX_TIMEOUT_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_LP_RX_TIMEOUT_REG
Lloh14:
	adrp	x8, _DSI_LP_RX_TIMEOUT_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DSI_LP_RX_TIMEOUT_MASK@GOTPAGEOFF]
	ldrh	w1, [x8]
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_TURN_AROUND_TIMEOUT_REG
Lloh16:
	adrp	x8, _DSI_TURN_AROUND_TIMEOUT_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DSI_TURN_AROUND_TIMEOUT_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	mov	w9, #20
	and	w1, w8, w9
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_DEVICE_RESET_TIMER_REG
Lloh19:
	adrp	x8, _DSI_RESET_TIMER_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DSI_RESET_TIMER_MASK@GOTPAGEOFF]
	ldrh	w1, [x8]
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_DPI_RESOLUTION_REG
	ldp	w8, w9, [x22, #8]
	orr	w1, w9, w8, lsl #16
	bl	_REG_WRITE
	ldr	w2, [x21]
	ldr	w3, [x21, #8]
	mov	x1, sp
	mov	x0, x22
	bl	_mdfld_dsi_dpi_timing_calculation
	mov	x0, x19
	bl	_MIPI_HSYNC_COUNT_REG
	ldr	w8, [sp]
Lloh21:
	adrp	x22, _DSI_DPI_TIMING_MASK@GOTPAGE
Lloh22:
	ldr	x22, [x22, _DSI_DPI_TIMING_MASK@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_HBP_COUNT_REG
	ldr	w8, [sp, #4]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_HFP_COUNT_REG
	ldr	w8, [sp, #8]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_HACTIVE_COUNT_REG
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_VSYNC_COUNT_REG
	ldr	w8, [sp, #16]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_VBP_COUNT_REG
	ldr	w8, [sp, #20]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_VFP_COUNT_REG
	ldr	w8, [sp, #24]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_HIGH_LOW_SWITCH_COUNT_REG
	mov	w1, #70
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_INIT_COUNT_REG
	mov	w1, #2000
	bl	_REG_WRITE
	ldr	w8, [x21, #12]
Lloh23:
	adrp	x9, _DSI_DPI_COMPLETE_LAST_LINE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DSI_DPI_COMPLETE_LAST_LINE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w21, w9, w8
	mov	x0, x19
	bl	_MIPI_VIDEO_MODE_FORMAT_REG
	mov	x1, x21
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_EOT_DISABLE_REG
	mov	w1, #0
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_LP_BYTECLK_REG
	mov	w1, #4
	bl	_REG_WRITE
	mov	x0, x20
	mov	x1, x19
	bl	_mdfld_get_panel_type
	mov	x21, x0
Lloh26:
	adrp	x22, _TC35876X@GOTPAGE
Lloh27:
	ldr	x22, [x22, _TC35876X@GOTPAGEOFF]
	ldr	x23, [x22]
	mov	x0, x19
	bl	_MIPI_DPHY_PARAM_REG
	cmp	x21, x23
	mov	w8, #13320
	movk	w8, #5388, lsl #16
	mov	w9, #24584
	movk	w9, #10764, lsl #16
	csel	w1, w9, w8, eq
	bl	_REG_WRITE
	mov	x0, x19
	bl	_MIPI_CLK_LANE_SWITCH_TIME_CNT_REG
	mov	w1, #20
	movk	w1, #10, lsl #16
	bl	_REG_WRITE
	mov	x0, x20
	mov	x1, x19
	bl	_mdfld_get_panel_type
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x20
	mov	w1, #0
	bl	_tc35876x_set_bridge_reset_state
LBB0_10:
	mov	x0, x19
	bl	_MIPI_DEVICE_READY_REG
	mov	w1, #1
	mov	w2, #0
	mov	w3, #0
	bl	_REG_FLD_MOD
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DSI_DPI_VIRT_CHANNEL_OFFSET,4,2 ; @DSI_DPI_VIRT_CHANNEL_OFFSET
	.comm	_DSI_DPI_COLOR_FORMAT_RGB565,4,2 ; @DSI_DPI_COLOR_FORMAT_RGB565
	.comm	_DSI_DPI_COLOR_FORMAT_RGB666,4,2 ; @DSI_DPI_COLOR_FORMAT_RGB666
	.comm	_DSI_DPI_COLOR_FORMAT_RGB888,4,2 ; @DSI_DPI_COLOR_FORMAT_RGB888
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported color format, bpp = %d\n"

	.comm	_DSI_HS_TX_TIMEOUT_MASK,4,2     ; @DSI_HS_TX_TIMEOUT_MASK
	.comm	_DSI_LP_RX_TIMEOUT_MASK,4,2     ; @DSI_LP_RX_TIMEOUT_MASK
	.comm	_DSI_TURN_AROUND_TIMEOUT_MASK,4,2 ; @DSI_TURN_AROUND_TIMEOUT_MASK
	.comm	_DSI_RESET_TIMER_MASK,4,2       ; @DSI_RESET_TIMER_MASK
	.comm	_DSI_DPI_TIMING_MASK,4,2        ; @DSI_DPI_TIMING_MASK
	.comm	_DSI_DPI_COMPLETE_LAST_LINE,4,2 ; @DSI_DPI_COMPLETE_LAST_LINE
	.comm	_TC35876X,8,3                   ; @TC35876X
.subsections_via_symbols
