	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ti_sn_bridge_enable
_ti_sn_bridge_enable:                   ## @ti_sn_bridge_enable
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_bridge_to_ti_sn_bridge
	movq	%rax, %rbx
	movq	16(%rax), %rax
	movl	$4, %edi
	subq	(%rax), %rdi
	callq	_CHA_DSI_LANES
	movl	4(%rbx), %edi
	movq	_SN_DSI_LANES_REG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CHA_DSI_LANES_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	decq	%rdi
	callq	_DP_NUM_LANES
	movl	%eax, %r14d
	movl	4(%rbx), %edi
	movq	_SN_SSC_CONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DP_NUM_LANES_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %ecx
	callq	_regmap_update_bits
	movq	%rbx, %rdi
	callq	_ti_sn_bridge_set_dsi_dp_rate
	movl	4(%rbx), %edi
	movq	_SN_PLL_ENABLE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_regmap_write
	movl	4(%rbx), %edi
	movq	_SN_DPPLL_SRC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DPPLL_SRC_DP_PLL_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r14d, %ecx
	movl	%r14d, %edx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	$50000, %r9d                    ## imm = 0xC350
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	addq	$8, %rdi
	movq	_DP_EDP_CONFIGURATION_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DP_ALTERNATE_SCRAMBLER_RESET_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_drm_dp_dpcd_writeb
	movl	4(%rbx), %edi
	movq	_SN_ML_TX_MODE_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$10, %edx
	callq	_regmap_write
	movl	4(%rbx), %edi
	movq	_ML_TX_MAIN_LINK_OFF@GOTPCREL(%rip), %r15
	cmpl	(%r15), %r14d
	sete	%al
	movq	_ML_TX_NORMAL_MODE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	movl	(%r12), %esi
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %ecx
	movl	%r14d, %edx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	$500000, %r9d                   ## imm = 0x7A120
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	movl	%eax, %esi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_5:
	cmpl	(%r15), %r14d
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_7:
	movq	%rbx, %rdi
	callq	_ti_sn_bridge_set_video_timings
	movl	4(%rbx), %edi
	movq	_SN_ENH_FRAME_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VSTREAM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	movl	(%rbx), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_panel_enable               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SN_DSI_LANES_REG,4,2           ## @SN_DSI_LANES_REG
	.comm	_CHA_DSI_LANES_MASK,4,2         ## @CHA_DSI_LANES_MASK
	.comm	_SN_SSC_CONFIG_REG,4,2          ## @SN_SSC_CONFIG_REG
	.comm	_DP_NUM_LANES_MASK,4,2          ## @DP_NUM_LANES_MASK
	.comm	_SN_PLL_ENABLE_REG,4,2          ## @SN_PLL_ENABLE_REG
	.comm	_SN_DPPLL_SRC_REG,4,2           ## @SN_DPPLL_SRC_REG
	.comm	_DPPLL_SRC_DP_PLL_LOCK,4,2      ## @DPPLL_SRC_DP_PLL_LOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DP_PLL_LOCK polling failed (%d)\n"

	.comm	_DP_EDP_CONFIGURATION_SET,4,2   ## @DP_EDP_CONFIGURATION_SET
	.comm	_DP_ALTERNATE_SCRAMBLER_RESET_ENABLE,4,2 ## @DP_ALTERNATE_SCRAMBLER_RESET_ENABLE
	.comm	_SN_ML_TX_MODE_REG,4,2          ## @SN_ML_TX_MODE_REG
	.comm	_ML_TX_MAIN_LINK_OFF,4,2        ## @ML_TX_MAIN_LINK_OFF
	.comm	_ML_TX_NORMAL_MODE,4,2          ## @ML_TX_NORMAL_MODE
L_.str.1:                               ## @.str.1
	.asciz	"Training complete polling failed (%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Link training failed, link is off\n"

	.comm	_SN_ENH_FRAME_REG,4,2           ## @SN_ENH_FRAME_REG
	.comm	_VSTREAM_ENABLE,4,2             ## @VSTREAM_ENABLE
	.no_dead_strip	_ti_sn_bridge_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ti_sn_bridge_enable
_ti_sn_bridge_enable:                   ; @ti_sn_bridge_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	bl	_bridge_to_ti_sn_bridge
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	mov	w9, #4
	sub	x0, x9, x8
	bl	_CHA_DSI_LANES
	mov	x3, x0
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x8, _SN_DSI_LANES_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SN_DSI_LANES_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CHA_DSI_LANES_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHA_DSI_LANES_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_regmap_update_bits
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	sub	x0, x8, #1
	bl	_DP_NUM_LANES
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _SN_SSC_CONFIG_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SN_SSC_CONFIG_REG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _DP_NUM_LANES_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DP_NUM_LANES_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x3, x20
	bl	_regmap_update_bits
	mov	x0, x19
	bl	_ti_sn_bridge_set_dsi_dp_rate
	ldr	w0, [x19, #4]
Lloh12:
	adrp	x8, _SN_PLL_ENABLE_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SN_PLL_ENABLE_REG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_regmap_write
Lloh15:
	adrp	x8, _SN_DPPLL_SRC_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SN_DPPLL_SRC_REG@GOTPAGEOFF]
	ldr	w0, [x19, #4]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _DPPLL_SRC_DP_PLL_LOCK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DPPLL_SRC_DP_PLL_LOCK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	and	w3, w8, w20
	mov	x2, x20
	mov	w4, #1000
	mov	w5, #50000
	bl	_regmap_read_poll_timeout
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	add	x0, x19, #8
Lloh23:
	adrp	x8, _DP_EDP_CONFIGURATION_SET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DP_EDP_CONFIGURATION_SET@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _DP_ALTERNATE_SCRAMBLER_RESET_ENABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DP_ALTERNATE_SCRAMBLER_RESET_ENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	bl	_drm_dp_dpcd_writeb
	ldr	w0, [x19, #4]
Lloh29:
	adrp	x21, _SN_ML_TX_MODE_REG@GOTPAGE
Lloh30:
	ldr	x21, [x21, _SN_ML_TX_MODE_REG@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w2, #10
	bl	_regmap_write
	ldr	w0, [x19, #4]
	ldr	w1, [x21]
Lloh31:
	adrp	x21, _ML_TX_MAIN_LINK_OFF@GOTPAGE
Lloh32:
	ldr	x21, [x21, _ML_TX_MAIN_LINK_OFF@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w20, w8
Lloh33:
	adrp	x8, _ML_TX_NORMAL_MODE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ML_TX_NORMAL_MODE@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ccmp	w20, w8, #4, ne
	cset	w3, eq
	mov	x2, x20
	mov	w4, #1000
	mov	w5, #41248
	movk	w5, #7, lsl #16
	bl	_regmap_read_poll_timeout
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_5
; %bb.3:
	str	x0, [sp]
Lloh36:
	adrp	x0, l_.str.1@PAGE
Lloh37:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
	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
	add	sp, sp, #64
	ret
LBB0_5:
	ldr	w8, [x21]
	cmp	w20, w8
	b.ne	LBB0_7
; %bb.6:
Lloh38:
	adrp	x0, l_.str.2@PAGE
Lloh39:
	add	x0, x0, l_.str.2@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
	add	sp, sp, #64
	b	_DRM_ERROR
LBB0_7:
	mov	x0, x19
	bl	_ti_sn_bridge_set_video_timings
	ldr	w0, [x19, #4]
Lloh40:
	adrp	x8, _SN_ENH_FRAME_REG@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SN_ENH_FRAME_REG@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
Lloh43:
	adrp	x8, _VSTREAM_ENABLE@GOTPAGE
Lloh44:
	ldr	x8, [x8, _VSTREAM_ENABLE@GOTPAGEOFF]
Lloh45:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	ldr	w0, [x19]
	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
	add	sp, sp, #64
	b	_drm_panel_enable
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_SN_DSI_LANES_REG,4,2           ; @SN_DSI_LANES_REG
	.comm	_CHA_DSI_LANES_MASK,4,2         ; @CHA_DSI_LANES_MASK
	.comm	_SN_SSC_CONFIG_REG,4,2          ; @SN_SSC_CONFIG_REG
	.comm	_DP_NUM_LANES_MASK,4,2          ; @DP_NUM_LANES_MASK
	.comm	_SN_PLL_ENABLE_REG,4,2          ; @SN_PLL_ENABLE_REG
	.comm	_SN_DPPLL_SRC_REG,4,2           ; @SN_DPPLL_SRC_REG
	.comm	_DPPLL_SRC_DP_PLL_LOCK,4,2      ; @DPPLL_SRC_DP_PLL_LOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DP_PLL_LOCK polling failed (%d)\n"

	.comm	_DP_EDP_CONFIGURATION_SET,4,2   ; @DP_EDP_CONFIGURATION_SET
	.comm	_DP_ALTERNATE_SCRAMBLER_RESET_ENABLE,4,2 ; @DP_ALTERNATE_SCRAMBLER_RESET_ENABLE
	.comm	_SN_ML_TX_MODE_REG,4,2          ; @SN_ML_TX_MODE_REG
	.comm	_ML_TX_MAIN_LINK_OFF,4,2        ; @ML_TX_MAIN_LINK_OFF
	.comm	_ML_TX_NORMAL_MODE,4,2          ; @ML_TX_NORMAL_MODE
l_.str.1:                               ; @.str.1
	.asciz	"Training complete polling failed (%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Link training failed, link is off\n"

	.comm	_SN_ENH_FRAME_REG,4,2           ; @SN_ENH_FRAME_REG
	.comm	_VSTREAM_ENABLE,4,2             ; @VSTREAM_ENABLE
	.no_dead_strip	_ti_sn_bridge_enable
.subsections_via_symbols
