	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxt_update_cfg
_mxt_update_cfg:                        ## @mxt_update_cfg
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	48(%rdi), %r13
	movl	(%rsi), %esi
	movl	4(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_kmemdup_nul
	movq	%rax, -96(%rbp)
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r14
	movl	(%rbx), %eax
	movl	%eax, -56(%rbp)
	movq	_MXT_COMMAND_REPORTALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_mxt_update_crc
	movq	_MXT_CFG_MAGIC@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movl	%ebx, %edi
	callq	_strlen
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
LBB0_3:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	jmp	LBB0_21
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_23
LBB0_6:
	movq	%r13, %rbx
	movl	(%r12), %edi
	callq	_strlen
	movq	%rax, -80(%rbp)
	leaq	-72(%rbp), %r12
	addq	%rax, %r14
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_19
## %bb.7:
	movslq	-44(%rbp), %rdi
	addq	-80(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	addq	-96(%rbp), %rdi
	leaq	1(%r12), %rdx
	leaq	L_.str.1(%rip), %rsi
	leaq	-44(%rbp), %rcx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_19
## %bb.8:
	movslq	-44(%rbp), %rdi
	addq	-80(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	addq	-96(%rbp), %rdi
	leaq	2(%r12), %rdx
	leaq	L_.str.1(%rip), %rsi
	leaq	-44(%rbp), %rcx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_19
## %bb.9:
	movslq	-44(%rbp), %rdi
	addq	-80(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	addq	-96(%rbp), %rdi
	addq	$3, %r12
	leaq	L_.str.1(%rip), %rsi
	leaq	-44(%rbp), %rcx
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_19
## %bb.10:
	movslq	-44(%rbp), %rdi
	addq	-80(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	movq	-72(%rbp), %rcx
	movq	40(%r15), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_24
## %bb.11:
	movq	-64(%rbp), %rcx
	cmpq	8(%rax), %rcx
	jne	LBB0_25
## %bb.12:
	addq	-96(%rbp), %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r13d, %r13d
	leaq	-128(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_27
## %bb.13:
	movslq	-44(%rbp), %rdi
	addq	-80(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	addq	-96(%rbp), %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r13d, %r13d
	leaq	-120(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_28
## %bb.14:
	movslq	-44(%rbp), %rax
	addq	%rax, -80(%rbp)
	movq	-128(%rbp), %rcx
	movq	(%r15), %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_29
## %bb.15:
	movq	-120(%rbp), %rcx
	testq	%rcx, %rcx
	movq	%rbx, %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	je	LBB0_30
## %bb.16:
	movq	8(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_30
## %bb.17:
	cmpq	%rdx, %rcx
	jne	LBB0_31
## %bb.18:
	leaq	L_.str.9(%rip), %rsi
	movq	%rcx, %rdx
	callq	_dev_dbg
	xorl	%r13d, %r13d
	jmp	LBB0_22
LBB0_19:
	leaq	L_.str.2(%rip), %rsi
LBB0_20:
	movq	%rbx, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_21:
	subl	(%rax), %r13d
LBB0_22:
	movq	-96(%rbp), %rdi
	callq	_kfree
LBB0_23:
	movl	%r13d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_26
LBB0_25:
	leaq	L_.str.4(%rip), %rsi
LBB0_26:
	movq	%rbx, %rdi
	jmp	LBB0_3
LBB0_27:
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_20
LBB0_28:
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_20
LBB0_29:
	leaq	L_.str.11(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	jmp	LBB0_32
LBB0_30:
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_32
LBB0_31:
	leaq	L_.str.10(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_32:
	movq	_MXT_OBJECT_START@GOTPCREL(%rip), %rax
	movq	40(%r15), %rcx
	movslq	16(%rcx), %rcx
	movq	_MXT_INFO_CHECKSUM_SIZE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	addq	(%rax), %rdx
	leaq	(%rdx,%rcx,4), %rax
	movq	%rax, -112(%rbp)
	movq	16(%r15), %rdi
	subq	%rax, %rdi
	movq	%rdi, -104(%rbp)
	movl	(%r14), %esi
	callq	_kzalloc
	movq	%rax, -88(%rbp)
	testq	%rax, %rax
	je	LBB0_45
## %bb.33:
	leaq	-112(%rbp), %rsi
	movq	%r15, %rdi
	callq	_mxt_prepare_cfg_mem
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_44
## %bb.34:
	movq	24(%r15), %r14
	testq	%r14, %r14
	jne	LBB0_37
## %bb.35:
	movq	32(%r15), %r14
	testq	%r14, %r14
	jne	LBB0_37
## %bb.36:
	leaq	L_.str.12(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_37:
	subq	-112(%rbp), %r14
	jle	LBB0_41
## %bb.38:
	movq	-104(%rbp), %rdx
	movq	-88(%rbp), %rdi
	movq	%r14, %rsi
	callq	_mxt_calculate_crc
	movq	-120(%rbp), %rcx
	testq	%rcx, %rcx
	jle	LBB0_41
## %bb.39:
	cmpq	%rax, %rcx
	je	LBB0_41
## %bb.40:
	leaq	L_.str.13(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_41:
	leaq	-112(%rbp), %rsi
	movq	%r15, %rdi
	callq	_mxt_upload_cfg_mem
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_44
## %bb.42:
	movq	_MXT_COMMAND_BACKUPNV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MXT_BACKUP_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_mxt_update_crc
	movq	%r15, %rdi
	callq	_mxt_soft_reset
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_44
## %bb.43:
	leaq	L_.str.14(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movq	%r15, %rdi
	callq	_mxt_init_t7_power_cfg
LBB0_44:
	movq	-88(%rbp), %rdi
	callq	_kfree
	jmp	LBB0_22
LBB0_45:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MXT_COMMAND_REPORTALL,4,2      ## @MXT_COMMAND_REPORTALL
	.comm	_MXT_CFG_MAGIC,4,2              ## @MXT_CFG_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unrecognised config file\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"%hhx%n"

L_.str.2:                               ## @.str.2
	.asciz	"Bad format\n"

L_.str.3:                               ## @.str.3
	.asciz	"Family ID mismatch!\n"

L_.str.4:                               ## @.str.4
	.asciz	"Variant ID mismatch!\n"

L_.str.5:                               ## @.str.5
	.asciz	"%x%n"

L_.str.6:                               ## @.str.6
	.asciz	"Bad format: failed to parse Info CRC\n"

L_.str.7:                               ## @.str.7
	.asciz	"Bad format: failed to parse Config CRC\n"

L_.str.8:                               ## @.str.8
	.asciz	"CRC zero, attempting to apply config\n"

L_.str.9:                               ## @.str.9
	.asciz	"Config CRC 0x%06X: OK\n"

L_.str.10:                              ## @.str.10
	.asciz	"Config CRC 0x%06X: does not match file 0x%06X\n"

L_.str.11:                              ## @.str.11
	.asciz	"Warning: Info CRC error - device=0x%06X file=0x%06X\n"

	.comm	_MXT_OBJECT_START,8,3           ## @MXT_OBJECT_START
	.comm	_MXT_INFO_CHECKSUM_SIZE,8,3     ## @MXT_INFO_CHECKSUM_SIZE
L_.str.12:                              ## @.str.12
	.asciz	"Could not find CRC start\n"

L_.str.13:                              ## @.str.13
	.asciz	"Config CRC in file inconsistent, calculated=%06X, file=%06X\n"

	.comm	_MXT_COMMAND_BACKUPNV,4,2       ## @MXT_COMMAND_BACKUPNV
	.comm	_MXT_BACKUP_VALUE,4,2           ## @MXT_BACKUP_VALUE
L_.str.14:                              ## @.str.14
	.asciz	"Config successfully updated\n"

	.no_dead_strip	_mxt_update_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxt_update_cfg
_mxt_update_cfg:                        ; @mxt_update_cfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x22, x1
	mov	x20, x0
	ldr	x19, [x0, #48]
	ldp	w1, w0, [x1]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_kmemdup_nul
	str	x0, [sp, #64]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	w8, [x22]
	str	w8, [sp, #104]
Lloh2:
	adrp	x8, _MXT_COMMAND_REPORTALL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MXT_COMMAND_REPORTALL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_mxt_update_crc
Lloh5:
	adrp	x24, _MXT_CFG_MAGIC@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MXT_CFG_MAGIC@GOTPAGEOFF]
	ldr	w22, [x24]
	mov	x0, x22
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_strncmp
	cbz	x0, LBB0_4
; %bb.2:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_18
LBB0_3:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_4:
	ldr	w0, [x24]
	bl	_strlen
	str	x0, [sp, #80]
	add	x8, sp, #48
	add	x22, x8, #40
	add	x0, x0, x21
	add	x21, sp, #44
	stp	x22, x21, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.5:
	ldrsw	x8, [sp, #44]
	ldr	x9, [sp, #80]
	ldr	x10, [sp, #64]
	add	x8, x9, x8
	add	x0, x8, x10
	str	x8, [sp, #80]
	add	x8, x22, #1
	stp	x8, x21, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.6:
	ldrsw	x8, [sp, #44]
	ldr	x9, [sp, #80]
	ldr	x10, [sp, #64]
	add	x8, x9, x8
	add	x0, x8, x10
	str	x8, [sp, #80]
	add	x8, x22, #2
	add	x21, sp, #44
	stp	x8, x21, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.7:
	ldrsw	x8, [sp, #44]
	ldr	x9, [sp, #80]
	ldr	x10, [sp, #64]
	add	x8, x9, x8
	add	x0, x8, x10
	str	x8, [sp, #80]
	add	x8, x22, #3
	stp	x8, x21, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.8:
	ldrsw	x8, [sp, #44]
	ldp	x9, x10, [sp, #80]
	add	x8, x9, x8
	str	x8, [sp, #80]
	ldr	x9, [x20, #40]
	ldr	x11, [x9]
	cmp	x10, x11
	b.ne	LBB0_22
; %bb.9:
	ldr	x10, [sp, #96]
	ldr	x9, [x9, #8]
	cmp	x10, x9
	b.ne	LBB0_23
; %bb.10:
	ldr	x9, [sp, #64]
	add	x0, x8, x9
	add	x21, sp, #44
	add	x8, sp, #32
	stp	x8, x21, [sp]
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_24
; %bb.11:
	ldrsw	x8, [sp, #44]
	ldr	x9, [sp, #80]
	ldr	x10, [sp, #64]
	add	x8, x9, x8
	add	x0, x10, x8
	str	x8, [sp, #80]
	add	x8, sp, #24
	stp	x8, x21, [sp]
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_25
; %bb.12:
	ldrsw	x8, [sp, #44]
	ldr	x9, [sp, #80]
	add	x8, x9, x8
	str	x8, [sp, #80]
	ldr	x8, [sp, #32]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.13:
	ldr	x2, [sp, #24]
	cbz	x2, LBB0_27
; %bb.14:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_27
; %bb.15:
	cmp	x2, x8
	b.ne	LBB0_28
; %bb.16:
Lloh24:
	adrp	x1, l_.str.9@PAGE
Lloh25:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w21, #0
	b	LBB0_20
LBB0_17:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_18:
	mov	x0, x19
	bl	_dev_err
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_20:
	ldr	x0, [sp, #64]
	bl	_kfree
LBB0_21:
	mov	x0, x21
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_22:
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_18
LBB0_23:
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_24:
Lloh34:
	adrp	x1, l_.str.6@PAGE
Lloh35:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_18
LBB0_25:
Lloh36:
	adrp	x1, l_.str.7@PAGE
Lloh37:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_18
LBB0_26:
	stp	x9, x8, [sp]
Lloh38:
	adrp	x1, l_.str.11@PAGE
Lloh39:
	add	x1, x1, l_.str.11@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	b	LBB0_30
LBB0_27:
Lloh40:
	adrp	x1, l_.str.8@PAGE
Lloh41:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_29
LBB0_28:
	stp	x8, x2, [sp]
Lloh42:
	adrp	x1, l_.str.10@PAGE
Lloh43:
	add	x1, x1, l_.str.10@PAGEOFF
LBB0_29:
	mov	x0, x19
	bl	_dev_info
LBB0_30:
Lloh44:
	adrp	x8, _MXT_OBJECT_START@GOTPAGE
Lloh45:
	ldr	x8, [x8, _MXT_OBJECT_START@GOTPAGEOFF]
Lloh46:
	ldr	x8, [x8]
	ldr	x9, [x20, #40]
	ldrsw	x9, [x9, #16]
Lloh47:
	adrp	x10, _MXT_INFO_CHECKSUM_SIZE@GOTPAGE
Lloh48:
	ldr	x10, [x10, _MXT_INFO_CHECKSUM_SIZE@GOTPAGEOFF]
Lloh49:
	ldr	x10, [x10]
	add	x8, x10, x8
	add	x8, x8, x9, lsl #2
	ldr	x9, [x20, #16]
	sub	x0, x9, x8
	stp	x8, x0, [sp, #48]
	ldr	w1, [x23]
	bl	_kzalloc
	str	x0, [sp, #72]
	cbz	x0, LBB0_43
; %bb.31:
	add	x1, sp, #48
	mov	x0, x20
	bl	_mxt_prepare_cfg_mem
	mov	x21, x0
	cbnz	w0, LBB0_42
; %bb.32:
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_35
; %bb.33:
	ldr	x8, [x20, #32]
	cbnz	x8, LBB0_35
; %bb.34:
Lloh50:
	adrp	x1, l_.str.12@PAGE
Lloh51:
	add	x1, x1, l_.str.12@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	mov	x8, #0
LBB0_35:
	ldr	x9, [sp, #48]
	subs	x1, x8, x9
	b.le	LBB0_39
; %bb.36:
	ldr	x0, [sp, #72]
	ldr	x2, [sp, #56]
	bl	_mxt_calculate_crc
	ldr	x8, [sp, #24]
	cmp	x8, #1
	b.lt	LBB0_39
; %bb.37:
	cmp	x8, x0
	b.eq	LBB0_39
; %bb.38:
	stp	x0, x8, [sp]
Lloh52:
	adrp	x1, l_.str.13@PAGE
Lloh53:
	add	x1, x1, l_.str.13@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_39:
	add	x1, sp, #48
	mov	x0, x20
	bl	_mxt_upload_cfg_mem
	mov	x21, x0
	cbnz	w0, LBB0_42
; %bb.40:
Lloh54:
	adrp	x8, _MXT_COMMAND_BACKUPNV@GOTPAGE
Lloh55:
	ldr	x8, [x8, _MXT_COMMAND_BACKUPNV@GOTPAGEOFF]
Lloh56:
	ldr	w1, [x8]
Lloh57:
	adrp	x8, _MXT_BACKUP_VALUE@GOTPAGE
Lloh58:
	ldr	x8, [x8, _MXT_BACKUP_VALUE@GOTPAGEOFF]
Lloh59:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mxt_update_crc
	mov	x0, x20
	bl	_mxt_soft_reset
	mov	x21, x0
	cbnz	w0, LBB0_42
; %bb.41:
Lloh60:
	adrp	x1, l_.str.14@PAGE
Lloh61:
	add	x1, x1, l_.str.14@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	x0, x20
	bl	_mxt_init_t7_power_cfg
LBB0_42:
	ldr	x0, [sp, #72]
	bl	_kfree
	b	LBB0_20
LBB0_43:
Lloh62:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh63:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpLdrGot	Lloh62, Lloh63
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MXT_COMMAND_REPORTALL,4,2      ; @MXT_COMMAND_REPORTALL
	.comm	_MXT_CFG_MAGIC,4,2              ; @MXT_CFG_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unrecognised config file\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"%hhx%n"

l_.str.2:                               ; @.str.2
	.asciz	"Bad format\n"

l_.str.3:                               ; @.str.3
	.asciz	"Family ID mismatch!\n"

l_.str.4:                               ; @.str.4
	.asciz	"Variant ID mismatch!\n"

l_.str.5:                               ; @.str.5
	.asciz	"%x%n"

l_.str.6:                               ; @.str.6
	.asciz	"Bad format: failed to parse Info CRC\n"

l_.str.7:                               ; @.str.7
	.asciz	"Bad format: failed to parse Config CRC\n"

l_.str.8:                               ; @.str.8
	.asciz	"CRC zero, attempting to apply config\n"

l_.str.9:                               ; @.str.9
	.asciz	"Config CRC 0x%06X: OK\n"

l_.str.10:                              ; @.str.10
	.asciz	"Config CRC 0x%06X: does not match file 0x%06X\n"

l_.str.11:                              ; @.str.11
	.asciz	"Warning: Info CRC error - device=0x%06X file=0x%06X\n"

	.comm	_MXT_OBJECT_START,8,3           ; @MXT_OBJECT_START
	.comm	_MXT_INFO_CHECKSUM_SIZE,8,3     ; @MXT_INFO_CHECKSUM_SIZE
l_.str.12:                              ; @.str.12
	.asciz	"Could not find CRC start\n"

l_.str.13:                              ; @.str.13
	.asciz	"Config CRC in file inconsistent, calculated=%06X, file=%06X\n"

	.comm	_MXT_COMMAND_BACKUPNV,4,2       ; @MXT_COMMAND_BACKUPNV
	.comm	_MXT_BACKUP_VALUE,4,2           ; @MXT_BACKUP_VALUE
l_.str.14:                              ; @.str.14
	.asciz	"Config successfully updated\n"

	.no_dead_strip	_mxt_update_cfg
.subsections_via_symbols
