	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_dp_phy_power_on
_rockchip_dp_phy_power_on:              ## @rockchip_dp_phy_power_on
	.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
	callq	_phy_get_drvdata
	movq	%rax, %r15
	movq	24(%rax), %r12
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_tcphy_get_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_MODE_DFP_DP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ebx, %ecx
	je	LBB0_7
## %bb.2:
	movl	(%r15), %eax
	xorl	%r13d, %r13d
	cmpl	%ebx, %eax
	je	LBB0_18
## %bb.3:
	movq	_MODE_DISCONNECT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%ecx, %ebx
	jne	LBB0_8
## %bb.4:
	cmpl	%edx, %eax
	je	LBB0_8
## %bb.5:
	movq	%r15, %rdi
	callq	_tcphy_phy_deinit
	jmp	LBB0_9
LBB0_6:
	movl	%ebx, %r13d
	jmp	LBB0_18
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_18
LBB0_8:
	cmpl	%edx, %eax
	jne	LBB0_10
LBB0_9:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_tcphy_phy_init
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
LBB0_10:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_property_enable
	movq	_readl@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_DP_MODE_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movq	_PHY_MODE_SET_TIMEOUT@GOTPCREL(%rip), %r12
	movl	(%r12), %r9d
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_readx_poll_timeout
	testl	%eax, %eax
	js	LBB0_13
## %bb.11:
	movq	%r15, %rdi
	callq	_tcphy_dp_aux_calibration
	movq	_DP_MODE_ENTER_A0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DP_MODE_CTL@GOTPCREL(%rip), %rax
	movq	%rbx, %r13
	movq	%rax, %rbx
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	(%r13), %edi
	movq	(%rbx), %rsi
	addq	16(%r15), %rsi
	movl	(%r12), %r9d
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_readx_poll_timeout
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_14
## %bb.12:
	movq	_MODE_DFP_DP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	jmp	LBB0_16
LBB0_13:
	movl	%eax, %r13d
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_15
LBB0_14:
	movq	_DP_MODE_ENTER_A2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DP_MODE_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	8(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_15:
	callq	_dev_err
LBB0_16:
	movq	_MODE_DISCONNECT@GOTPCREL(%rip), %rcx
	movl	(%r15), %eax
	cmpl	(%rcx), %eax
	jne	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_tcphy_phy_deinit
LBB0_18:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_DFP_DP,4,2                ## @MODE_DFP_DP
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MODE_DISCONNECT,4,2            ## @MODE_DISCONNECT
	.comm	_readl,4,2                      ## @readl
	.comm	_DP_MODE_CTL,8,3                ## @DP_MODE_CTL
	.comm	_DP_MODE_A2,4,2                 ## @DP_MODE_A2
	.comm	_PHY_MODE_SET_TIMEOUT,4,2       ## @PHY_MODE_SET_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to wait TCPHY enter A2\n"

	.comm	_DP_MODE_ENTER_A0,4,2           ## @DP_MODE_ENTER_A0
	.comm	_DP_MODE_A0,4,2                 ## @DP_MODE_A0
	.comm	_DP_MODE_ENTER_A2,4,2           ## @DP_MODE_ENTER_A2
L_.str.1:                               ## @.str.1
	.asciz	"failed to wait TCPHY enter A0\n"

	.no_dead_strip	_rockchip_dp_phy_power_on
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_dp_phy_power_on
_rockchip_dp_phy_power_on:              ; @rockchip_dp_phy_power_on
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	bl	_phy_get_drvdata
	mov	x20, x0
	ldr	x22, [x0, #24]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_tcphy_get_mode
	mov	x21, x0
	tbnz	w0, #31, LBB0_17
; %bb.1:
Lloh0:
	adrp	x24, _MODE_DFP_DP@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MODE_DFP_DP@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.2:
	ldr	w9, [x20]
	cmp	w9, w21
	b.ne	LBB0_5
; %bb.3:
	mov	w21, #0
	b	LBB0_17
LBB0_4:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_5:
Lloh5:
	adrp	x23, _MODE_DISCONNECT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MODE_DISCONNECT@GOTPAGEOFF]
	ldr	w10, [x23]
	cmp	w21, w8
	ccmp	w9, w10, #4, eq
	b.ne	LBB0_7
; %bb.6:
	cmp	w9, w10
	b.eq	LBB0_8
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	bl	_tcphy_phy_deinit
LBB0_8:
	mov	x0, x20
	mov	x1, x21
	bl	_tcphy_phy_init
	mov	x21, x0
	cbnz	w0, LBB0_17
LBB0_9:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #1
	bl	_property_enable
Lloh7:
	adrp	x25, _readl@GOTPAGE
Lloh8:
	ldr	x25, [x25, _readl@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh9:
	adrp	x22, _DP_MODE_CTL@GOTPAGE
Lloh10:
	ldr	x22, [x22, _DP_MODE_CTL@GOTPAGEOFF]
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
Lloh11:
	adrp	x26, _PHY_MODE_SET_TIMEOUT@GOTPAGE
Lloh12:
	ldr	x26, [x26, _PHY_MODE_SET_TIMEOUT@GOTPAGEOFF]
	ldr	w5, [x26]
	mov	w3, #0
	mov	w4, #1000
	bl	_readx_poll_timeout
	tbnz	w0, #31, LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_tcphy_dp_aux_calibration
Lloh13:
	adrp	x8, _DP_MODE_ENTER_A0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DP_MODE_ENTER_A0@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x25]
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	ldr	w5, [x26]
	mov	w3, #0
	mov	w4, #1000
	bl	_readx_poll_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.11:
	ldr	w8, [x24]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	b	LBB0_15
LBB0_12:
	mov	x21, x0
	ldr	w0, [x20, #8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh18:
	adrp	x8, _DP_MODE_ENTER_A2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DP_MODE_ENTER_A2@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x20, #8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_14:
	bl	_dev_err
LBB0_15:
	ldr	w8, [x20]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x20
	bl	_tcphy_phy_deinit
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_DFP_DP,4,2                ; @MODE_DFP_DP
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MODE_DISCONNECT,4,2            ; @MODE_DISCONNECT
	.comm	_readl,4,2                      ; @readl
	.comm	_DP_MODE_CTL,8,3                ; @DP_MODE_CTL
	.comm	_DP_MODE_A2,4,2                 ; @DP_MODE_A2
	.comm	_PHY_MODE_SET_TIMEOUT,4,2       ; @PHY_MODE_SET_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to wait TCPHY enter A2\n"

	.comm	_DP_MODE_ENTER_A0,4,2           ; @DP_MODE_ENTER_A0
	.comm	_DP_MODE_A0,4,2                 ; @DP_MODE_A0
	.comm	_DP_MODE_ENTER_A2,4,2           ; @DP_MODE_ENTER_A2
l_.str.1:                               ; @.str.1
	.asciz	"failed to wait TCPHY enter A0\n"

	.no_dead_strip	_rockchip_dp_phy_power_on
.subsections_via_symbols
