	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function berlin2_adc_tsen_read
_berlin2_adc_tsen_read:                 ## @berlin2_adc_tsen_read
	.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	_iio_priv
	movq	%rax, %r15
	leaq	8(%rax), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	12(%r15), %edi
	movq	_BERLIN2_SM_TSEN_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BERLIN2_SM_TSEN_STATUS_INT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	12(%r15), %edi
	movq	_BERLIN2_SM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BERLIN2_SM_CTRL_TSEN_RESET@GOTPCREL(%rip), %rax
	movq	_BERLIN2_SM_CTRL_ADC_ROTATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%rax), %edx
	orl	%ecx, %edx
	callq	_regmap_update_bits
	movl	12(%r15), %r12d
	movq	_BERLIN2_SM_TSEN_CTRL@GOTPCREL(%rip), %rdx
	movq	_BERLIN2_SM_TSEN_CTRL_TRIM_MASK@GOTPCREL(%rip), %rax
	movq	_BERLIN2_SM_TSEN_CTRL_SETTLING_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	(%rdx), %r13d
	movq	_BERLIN2_SM_TSEN_CTRL_START@GOTPCREL(%rip), %r14
	orl	(%r14), %ebx
	movl	$3, %edi
	callq	_BERLIN2_SM_TSEN_CTRL_TRIM
	movq	_BERLIN2_SM_TSEN_CTRL_SETTLING_12@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	(%r14), %eax
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	(%r15), %r12d
	movl	16(%r15), %ebx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movl	%eax, %r12d
	movl	12(%r15), %edi
	movq	_BERLIN2_SM_TSEN_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BERLIN2_SM_TSEN_STATUS_INT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	testl	%r12d, %r12d
	cmovnel	%r12d, %ebx
	testl	%ebx, %ebx
	js	LBB0_2
## %bb.1:
	movl	12(%r15), %edi
	movq	_BERLIN2_SM_TSEN_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BERLIN2_SM_TSEN_CTRL_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movl	4(%r15), %ebx
	movl	$0, (%r15)
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BERLIN2_SM_TSEN_STATUS,4,2     ## @BERLIN2_SM_TSEN_STATUS
	.comm	_BERLIN2_SM_TSEN_STATUS_INT_EN,4,2 ## @BERLIN2_SM_TSEN_STATUS_INT_EN
	.comm	_BERLIN2_SM_CTRL,4,2            ## @BERLIN2_SM_CTRL
	.comm	_BERLIN2_SM_CTRL_TSEN_RESET,4,2 ## @BERLIN2_SM_CTRL_TSEN_RESET
	.comm	_BERLIN2_SM_CTRL_ADC_ROTATE,4,2 ## @BERLIN2_SM_CTRL_ADC_ROTATE
	.comm	_BERLIN2_SM_TSEN_CTRL,4,2       ## @BERLIN2_SM_TSEN_CTRL
	.comm	_BERLIN2_SM_TSEN_CTRL_TRIM_MASK,4,2 ## @BERLIN2_SM_TSEN_CTRL_TRIM_MASK
	.comm	_BERLIN2_SM_TSEN_CTRL_SETTLING_MASK,4,2 ## @BERLIN2_SM_TSEN_CTRL_SETTLING_MASK
	.comm	_BERLIN2_SM_TSEN_CTRL_START,4,2 ## @BERLIN2_SM_TSEN_CTRL_START
	.comm	_BERLIN2_SM_TSEN_CTRL_SETTLING_12,4,2 ## @BERLIN2_SM_TSEN_CTRL_SETTLING_12
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_berlin2_adc_tsen_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function berlin2_adc_tsen_read
_berlin2_adc_tsen_read:                 ; @berlin2_adc_tsen_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	bl	_iio_priv
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x20, #12]
Lloh0:
	adrp	x24, _BERLIN2_SM_TSEN_STATUS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BERLIN2_SM_TSEN_STATUS@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x25, _BERLIN2_SM_TSEN_STATUS_INT_EN@GOTPAGE
Lloh3:
	ldr	x25, [x25, _BERLIN2_SM_TSEN_STATUS_INT_EN@GOTPAGEOFF]
	ldr	w2, [x25]
	bl	_regmap_write
	ldr	w0, [x20, #12]
Lloh4:
	adrp	x8, _BERLIN2_SM_CTRL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BERLIN2_SM_CTRL@GOTPAGEOFF]
Lloh6:
	adrp	x9, _BERLIN2_SM_CTRL_TSEN_RESET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BERLIN2_SM_CTRL_TSEN_RESET@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	ldr	w8, [x9]
Lloh10:
	adrp	x9, _BERLIN2_SM_CTRL_ADC_ROTATE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BERLIN2_SM_CTRL_ADC_ROTATE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x9]
	orr	w2, w3, w8
	bl	_regmap_update_bits
	ldr	w21, [x20, #12]
Lloh13:
	adrp	x26, _BERLIN2_SM_TSEN_CTRL@GOTPAGE
Lloh14:
	ldr	x26, [x26, _BERLIN2_SM_TSEN_CTRL@GOTPAGEOFF]
	ldr	w22, [x26]
Lloh15:
	adrp	x8, _BERLIN2_SM_TSEN_CTRL_TRIM_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BERLIN2_SM_TSEN_CTRL_TRIM_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _BERLIN2_SM_TSEN_CTRL_SETTLING_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BERLIN2_SM_TSEN_CTRL_SETTLING_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x27, _BERLIN2_SM_TSEN_CTRL_START@GOTPAGE
Lloh22:
	ldr	x27, [x27, _BERLIN2_SM_TSEN_CTRL_START@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w23, w8, w9
	mov	w0, #3
	bl	_BERLIN2_SM_TSEN_CTRL_TRIM
Lloh23:
	adrp	x8, _BERLIN2_SM_TSEN_CTRL_SETTLING_12@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BERLIN2_SM_TSEN_CTRL_SETTLING_12@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w8, w8, w0
	ldr	w9, [x27]
	orr	w3, w8, w9
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_regmap_update_bits
	ldr	w21, [x20, #16]
	ldr	w22, [x20]
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_wait_event_interruptible_timeout
	mov	x21, x0
	ldr	w0, [x20, #12]
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	w3, #0
	bl	_regmap_update_bits
Lloh26:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w21, w21, w8, ne
	tbnz	w21, #31, LBB0_2
; %bb.1:
	ldr	w0, [x20, #12]
	ldr	w1, [x26]
	ldr	w2, [x27]
	mov	w3, #0
	bl	_regmap_update_bits
	ldr	w21, [x20, #4]
	str	wzr, [x20]
LBB0_2:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BERLIN2_SM_TSEN_STATUS,4,2     ; @BERLIN2_SM_TSEN_STATUS
	.comm	_BERLIN2_SM_TSEN_STATUS_INT_EN,4,2 ; @BERLIN2_SM_TSEN_STATUS_INT_EN
	.comm	_BERLIN2_SM_CTRL,4,2            ; @BERLIN2_SM_CTRL
	.comm	_BERLIN2_SM_CTRL_TSEN_RESET,4,2 ; @BERLIN2_SM_CTRL_TSEN_RESET
	.comm	_BERLIN2_SM_CTRL_ADC_ROTATE,4,2 ; @BERLIN2_SM_CTRL_ADC_ROTATE
	.comm	_BERLIN2_SM_TSEN_CTRL,4,2       ; @BERLIN2_SM_TSEN_CTRL
	.comm	_BERLIN2_SM_TSEN_CTRL_TRIM_MASK,4,2 ; @BERLIN2_SM_TSEN_CTRL_TRIM_MASK
	.comm	_BERLIN2_SM_TSEN_CTRL_SETTLING_MASK,4,2 ; @BERLIN2_SM_TSEN_CTRL_SETTLING_MASK
	.comm	_BERLIN2_SM_TSEN_CTRL_START,4,2 ; @BERLIN2_SM_TSEN_CTRL_START
	.comm	_BERLIN2_SM_TSEN_CTRL_SETTLING_12,4,2 ; @BERLIN2_SM_TSEN_CTRL_SETTLING_12
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_berlin2_adc_tsen_read
.subsections_via_symbols
