	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ks8995_probe
_ks8995_probe:                          ## @ks8995_probe
	.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
	movq	%rdi, %r12
	callq	_spi_get_device_id
	movslq	(%rax), %rbx
	movq	_max_variant@GOTPCREL(%rip), %rax
	leaq	8(%r12), %r14
	cmpl	(%rax), %ebx
	jge	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$48, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	leaq	40(%rax), %rdi
	callq	_mutex_init
	movq	%r12, 32(%r15)
	movq	_ks8995_chip@GOTPCREL(%rip), %rax
	leaq	(%rbx,%rbx,2), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 8(%r15)
	cmpq	$0, 24(%r12)
	je	LBB0_8
## %bb.6:
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$16, %esi
	callq	_devm_kzalloc
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	movl	$-1, (%rax)
	movq	%r15, %rdi
	callq	_ks8995_parse_dt
LBB0_8:
	movq	24(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movq	16(%r12), %rax
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_16
LBB0_10:
	movl	(%rax), %edi
	callq	_gpio_is_valid
	testq	%rax, %rax
	je	LBB0_16
## %bb.11:
	movq	24(%r15), %rax
	movq	8(%rax), %rcx
	movq	_OF_GPIO_ACTIVE_LOW@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.13:
	movq	_GPIOF_ACTIVE_LOW@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	xorl	%edx, %edx
LBB0_14:
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
	movq	%r14, %rdi
	callq	_devm_gpio_request_one
	testl	%eax, %eax
	je	LBB0_15
## %bb.25:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	24(%r15), %rax
	movl	(%rax), %edi
	callq	_gpio_to_desc
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_gpiod_set_value
LBB0_16:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_spi_set_drvdata
	movq	_SPI_MODE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movl	$8, (%r12)
	movq	%r12, %rdi
	callq	_spi_setup
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
LBB0_18:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_24
LBB0_19:
	movq	%r15, %rdi
	callq	_ks8995_get_revision
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.20:
	movq	%r15, %r12
	addq	$16, %r12
	movq	_ks8995_registers_attr@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movl	$8, %edx
	callq	_memcpy
	movq	8(%r15), %rax
	movl	8(%rax), %eax
	movl	%eax, 20(%r15)
	movq	%r15, %rdi
	callq	_ks8995_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.21:
	movq	%r12, %rdi
	callq	_sysfs_attr_init
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_sysfs_create_bin_file
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_18
LBB0_23:
	movq	8(%r15), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	movl	(%r15), %r8d
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_max_variant,4,2                ## @max_variant
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad chip variant %d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ks8995_chip,8,3                ## @ks8995_chip
	.comm	_OF_GPIO_ACTIVE_LOW,8,3         ## @OF_GPIO_ACTIVE_LOW
	.comm	_GPIOF_ACTIVE_LOW,8,3           ## @GPIOF_ACTIVE_LOW
L_.str.1:                               ## @.str.1
	.asciz	"switch-reset"

L_.str.2:                               ## @.str.2
	.asciz	"failed to get reset-gpios: %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SPI_MODE_0,4,2                 ## @SPI_MODE_0
L_.str.3:                               ## @.str.3
	.asciz	"spi_setup failed, err=%d\n"

	.comm	_ks8995_registers_attr,4,2      ## @ks8995_registers_attr
L_.str.4:                               ## @.str.4
	.asciz	"unable to create sysfs file, err=%d\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s device found, Chip ID:%x, Revision:%x\n"

	.no_dead_strip	_ks8995_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ks8995_probe
_ks8995_probe:                          ; @ks8995_probe
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	bl	_spi_get_device_id
	ldrsw	x22, [x0]
Lloh0:
	adrp	x8, _max_variant@GOTPAGE
Lloh1:
	ldr	x8, [x8, _max_variant@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	x19, x21, #8
	cmp	w22, w8
	b.ge	LBB0_10
; %bb.1:
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	mov	w1, #48
	bl	_devm_kzalloc
	cbz	x0, LBB0_11
; %bb.2:
	mov	x20, x0
	add	x0, x0, #40
	bl	_mutex_init
Lloh5:
	adrp	x8, _ks8995_chip@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ks8995_chip@GOTPAGEOFF]
	str	x21, [x20, #32]
Lloh7:
	ldr	x8, [x8]
	mov	w9, #12
	madd	x8, x22, x9, x8
	str	x8, [x20, #8]
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w2, [x23]
	mov	x0, x19
	mov	w1, #16
	bl	_devm_kzalloc
	str	x0, [x20, #24]
	cbz	x0, LBB0_11
; %bb.4:
	mov	w8, #-1
	str	w8, [x0]
	mov	x0, x20
	bl	_ks8995_parse_dt
LBB0_5:
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_7
; %bb.6:
	ldr	x8, [x21, #16]
	str	x8, [x20, #24]
	cbz	x8, LBB0_15
LBB0_7:
	ldr	w0, [x8]
	bl	_gpio_is_valid
	cbz	x0, LBB0_15
; %bb.8:
	ldr	x8, [x20, #24]
	ldr	x9, [x8, #8]
Lloh8:
	adrp	x10, _OF_GPIO_ACTIVE_LOW@GOTPAGE
Lloh9:
	ldr	x10, [x10, _OF_GPIO_ACTIVE_LOW@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
Lloh11:
	adrp	x11, _GPIOF_ACTIVE_LOW@GOTPAGE
Lloh12:
	ldr	x11, [x11, _GPIOF_ACTIVE_LOW@GOTPAGEOFF]
Lloh13:
	ldr	x11, [x11]
	cmp	x9, x10
	csel	x2, x11, xzr, eq
	ldr	w1, [x8]
Lloh14:
	adrp	x3, l_.str.1@PAGE
Lloh15:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_devm_gpio_request_one
	cbz	w0, LBB0_14
; %bb.9:
	mov	x2, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_dev_err
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	x8, [x20, #24]
	ldr	w0, [x8]
	bl	_gpio_to_desc
	mov	w1, #0
	bl	_gpiod_set_value
LBB0_15:
	mov	x0, x21
	mov	x1, x20
	bl	_spi_set_drvdata
Lloh26:
	adrp	x8, _SPI_MODE_0@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SPI_MODE_0@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x21, #32]
	mov	w8, #8
	str	w8, [x21]
	mov	x0, x21
	bl	_spi_setup
	cbz	w0, LBB0_18
; %bb.16:
	mov	x21, x0
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_17:
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err
	b	LBB0_13
LBB0_18:
	mov	x0, x20
	bl	_ks8995_get_revision
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.19:
	add	x22, x20, #16
Lloh31:
	adrp	x1, _ks8995_registers_attr@GOTPAGE
Lloh32:
	ldr	x1, [x1, _ks8995_registers_attr@GOTPAGEOFF]
	mov	x0, x22
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x20, #8]
	ldr	w8, [x8, #8]
	str	w8, [x20, #20]
	mov	x0, x20
	bl	_ks8995_reset
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.20:
	mov	x0, x22
	bl	_sysfs_attr_init
	mov	x0, x19
	mov	x1, x22
	bl	_sysfs_create_bin_file
	mov	x21, x0
	cbz	w0, LBB0_22
; %bb.21:
Lloh33:
	adrp	x1, l_.str.4@PAGE
Lloh34:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_22:
	ldr	x8, [x20, #8]
	ldp	w3, w2, [x8]
	ldr	w4, [x20]
Lloh35:
	adrp	x1, l_.str.5@PAGE
Lloh36:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_max_variant,4,2                ; @max_variant
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad chip variant %d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ks8995_chip,8,3                ; @ks8995_chip
	.comm	_OF_GPIO_ACTIVE_LOW,8,3         ; @OF_GPIO_ACTIVE_LOW
	.comm	_GPIOF_ACTIVE_LOW,8,3           ; @GPIOF_ACTIVE_LOW
l_.str.1:                               ; @.str.1
	.asciz	"switch-reset"

l_.str.2:                               ; @.str.2
	.asciz	"failed to get reset-gpios: %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SPI_MODE_0,4,2                 ; @SPI_MODE_0
l_.str.3:                               ; @.str.3
	.asciz	"spi_setup failed, err=%d\n"

	.comm	_ks8995_registers_attr,4,2      ; @ks8995_registers_attr
l_.str.4:                               ; @.str.4
	.asciz	"unable to create sysfs file, err=%d\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s device found, Chip ID:%x, Revision:%x\n"

	.no_dead_strip	_ks8995_probe
.subsections_via_symbols
