	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun8i_tcon_top_set_hdmi_src    ## -- Begin function sun8i_tcon_top_set_hdmi_src
	.p2align	4, 0x90
_sun8i_tcon_top_set_hdmi_src:           ## @sun8i_tcon_top_set_hdmi_src
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_sun8i_tcon_top_node_is_tcon_top
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	leal	-4(%r15), %eax
	cmpl	$-3, %eax
	ja	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movq	%rbx, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_TCON_TOP_GATE_SRC_REG@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movq	_TCON_TOP_HDMI_SRC_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%edi, %ebx
	notl	%ebx
	andl	%eax, %ebx
	decl	%r15d
	movl	%r15d, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	(%r12), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Device is not TCON TOP!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"TCON index must be 2 or 3!\n"

	.comm	_TCON_TOP_GATE_SRC_REG,8,3      ## @TCON_TOP_GATE_SRC_REG
	.comm	_TCON_TOP_HDMI_SRC_MSK,4,2      ## @TCON_TOP_HDMI_SRC_MSK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun8i_tcon_top_set_hdmi_src    ; -- Begin function sun8i_tcon_top_set_hdmi_src
	.p2align	2
_sun8i_tcon_top_set_hdmi_src:           ; @sun8i_tcon_top_set_hdmi_src
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_dev_get_drvdata
	mov	x19, x0
	ldr	w0, [x21]
	bl	_sun8i_tcon_top_node_is_tcon_top
	cbz	w0, LBB0_3
; %bb.1:
	sub	w8, w20, #4
	cmn	w8, #3
	b.hi	LBB0_5
; %bb.2:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x21
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh7:
	adrp	x21, _TCON_TOP_GATE_SRC_REG@GOTPAGE
Lloh8:
	ldr	x21, [x21, _TCON_TOP_GATE_SRC_REG@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
Lloh9:
	adrp	x8, _TCON_TOP_HDMI_SRC_MSK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TCON_TOP_HDMI_SRC_MSK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	bic	w22, w0, w8
	sub	w1, w20, #1
	mov	x0, x8
	bl	_FIELD_PREP
	orr	w0, w22, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Device is not TCON TOP!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"TCON index must be 2 or 3!\n"

	.comm	_TCON_TOP_GATE_SRC_REG,8,3      ; @TCON_TOP_GATE_SRC_REG
	.comm	_TCON_TOP_HDMI_SRC_MSK,4,2      ; @TCON_TOP_HDMI_SRC_MSK
.subsections_via_symbols
