	.file	"extr_btmtksdio.c_btmtksdio_open.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Cannot get ownership from device"
	.text
	.p2align 4
	.type	btmtksdio_open, @function
btmtksdio_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	hci_get_drvdata@PLT
	mov	edi, DWORD PTR [rax]
	mov	rbx, rax
	call	sdio_claim_host@PLT
	mov	edi, DWORD PTR [rbx]
	call	sdio_enable_func@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	js	.L2
	mov	edx, DWORD PTR MTK_REG_CHLPCR[rip]
	mov	esi, DWORD PTR C_FW_OWN_REQ_CLR[rip]
	lea	r12, 4[rsp]
	mov	edi, DWORD PTR [rbx]
	mov	rcx, r12
	call	sdio_writel@PLT
	mov	r9d, DWORD PTR 4[rsp]
	test	r9d, r9d
	js	.L4
	mov	ecx, DWORD PTR C_COM_DRV_OWN[rip]
	xor	edx, edx
	mov	rsi, rbx
	mov	edi, DWORD PTR btmtksdio_drv_own_query[rip]
	mov	r9d, 1000000
	mov	r8d, 2000
	and	ecx, edx
	call	readx_poll_timeout@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	js	.L12
	mov	edx, DWORD PTR MTK_REG_CHLPCR[rip]
	mov	esi, DWORD PTR C_INT_EN_CLR[rip]
	mov	rcx, r12
	mov	edi, DWORD PTR [rbx]
	call	sdio_writel@PLT
	mov	r8d, DWORD PTR 4[rsp]
	test	r8d, r8d
	js	.L4
	mov	edi, DWORD PTR [rbx]
	mov	edx, DWORD PTR MTK_REG_CHIER[rip]
	mov	rcx, r12
	xor	esi, esi
	call	sdio_writel@PLT
	mov	edi, DWORD PTR 4[rsp]
	test	edi, edi
	js	.L4
	mov	esi, DWORD PTR btmtksdio_interrupt[rip]
	mov	edi, DWORD PTR [rbx]
	call	sdio_claim_irq@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	js	.L4
	mov	esi, DWORD PTR MTK_SDIO_BLOCK_SIZE[rip]
	mov	edi, DWORD PTR [rbx]
	call	sdio_set_block_size@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	js	.L7
	mov	edx, DWORD PTR MTK_REG_CSDIOCSR[rip]
	mov	edi, DWORD PTR [rbx]
	mov	rcx, r12
	mov	esi, DWORD PTR SDIO_INT_CTL[rip]
	or	esi, DWORD PTR SDIO_RE_INIT_EN[rip]
	call	sdio_writel@PLT
	mov	esi, DWORD PTR 4[rsp]
	test	esi, esi
	js	.L7
	mov	edx, DWORD PTR MTK_REG_CHCR[rip]
	mov	esi, DWORD PTR C_INT_CLR_CTRL[rip]
	mov	rcx, r12
	mov	edi, DWORD PTR [rbx]
	call	sdio_writel@PLT
	mov	ecx, DWORD PTR 4[rsp]
	test	ecx, ecx
	js	.L7
	mov	edx, DWORD PTR MTK_REG_CHIER[rip]
	mov	edi, DWORD PTR [rbx]
	mov	rcx, r12
	mov	esi, DWORD PTR RX_DONE_INT[rip]
	or	esi, DWORD PTR TX_EMPTY[rip]
	or	esi, DWORD PTR TX_FIFO_OVERFLOW[rip]
	call	sdio_writel@PLT
	mov	edx, DWORD PTR 4[rsp]
	test	edx, edx
	js	.L7
	mov	edx, DWORD PTR MTK_REG_CHLPCR[rip]
	mov	esi, DWORD PTR C_INT_EN_SET[rip]
	mov	rcx, r12
	mov	edi, DWORD PTR [rbx]
	call	sdio_writel@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	eax, eax
	js	.L7
	mov	edi, DWORD PTR [rbx]
	call	sdio_release_host@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR [rbx]
	call	sdio_release_irq@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR [rbx]
	call	sdio_disable_func@PLT
.L2:
	mov	edi, DWORD PTR [rbx]
	call	sdio_release_host@PLT
	mov	eax, DWORD PTR 4[rsp]
.L1:
	mov	rsi, QWORD PTR 8[rsp]
	xor	rsi, QWORD PTR fs:40
	jne	.L13
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbx]
	lea	rsi, .LC0[rip]
	call	bt_dev_err@PLT
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	btmtksdio_open, .-btmtksdio_open
	.comm	btmtksdio_interrupt,4,4
	.comm	btmtksdio_drv_own_query,4,4
	.comm	TX_FIFO_OVERFLOW,4,4
	.comm	TX_EMPTY,4,4
	.comm	SDIO_RE_INIT_EN,4,4
	.comm	SDIO_INT_CTL,4,4
	.comm	RX_DONE_INT,4,4
	.comm	MTK_SDIO_BLOCK_SIZE,4,4
	.comm	MTK_REG_CSDIOCSR,4,4
	.comm	MTK_REG_CHLPCR,4,4
	.comm	MTK_REG_CHIER,4,4
	.comm	MTK_REG_CHCR,4,4
	.comm	C_INT_EN_SET,4,4
	.comm	C_INT_EN_CLR,4,4
	.comm	C_INT_CLR_CTRL,4,4
	.comm	C_FW_OWN_REQ_CLR,4,4
	.comm	C_COM_DRV_OWN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_btmtksdio.c_btmtksdio_open.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Cannot get ownership from device\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	btmtksdio_open, %function
btmtksdio_open:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L14
	sub	sp, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	hci_get_drvdata
	mov	r4, r0
	ldr	r0, [r0]
	bl	sdio_claim_host
	ldr	r0, [r4]
	bl	sdio_enable_func
	cmp	r0, #0
	str	r0, [sp, #8]
	blt	.L2
	ldr	r3, .L14+4
	ldr	r5, .L14+8
	ldr	r1, [r3]
	ldr	r2, [r5]
	add	r3, sp, #8
	ldr	r0, [r4]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L4
	mov	r1, #2000
	ldr	r2, .L14+12
	ldr	r3, .L14+16
	str	r1, [sp]
	ldr	r0, [r2]
	str	r3, [sp, #4]
	mov	r3, #0
	mov	r1, r4
	mov	r2, r3
	bl	readx_poll_timeout
	cmp	r0, #0
	str	r0, [sp, #8]
	blt	.L12
	ldr	r2, .L14+20
	add	r3, sp, #8
	ldr	r1, [r2]
	ldr	r0, [r4]
	ldr	r2, [r5]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L4
	ldr	r6, .L14+24
	add	r3, sp, #8
	mov	r1, #0
	ldr	r2, [r6]
	ldr	r0, [r4]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L4
	ldr	r3, .L14+28
	ldr	r0, [r4]
	ldr	r1, [r3]
	bl	sdio_claim_irq
	cmp	r0, #0
	str	r0, [sp, #8]
	blt	.L4
	ldr	r3, .L14+32
	ldr	r0, [r4]
	ldr	r1, [r3]
	bl	sdio_set_block_size
	cmp	r0, #0
	str	r0, [sp, #8]
	blt	.L7
	ldr	r2, .L14+36
	ldr	r3, .L14+40
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L14+44
	orr	r1, r1, r2
	ldr	r0, [r4]
	ldr	r2, [r3]
	add	r3, sp, #8
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L7
	ldr	r3, .L14+48
	ldr	r2, .L14+52
	ldr	r1, [r3]
	ldr	r2, [r2]
	add	r3, sp, #8
	ldr	r0, [r4]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L7
	ldr	r3, .L14+56
	ldr	r2, .L14+60
	ldr	r1, .L14+64
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r2
	orr	r1, r3, r1
	ldr	r2, [r6]
	add	r3, sp, #8
	ldr	r0, [r4]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L7
	ldr	r1, .L14+68
	add	r3, sp, #8
	ldr	r2, [r5]
	ldr	r1, [r1]
	ldr	r0, [r4]
	bl	sdio_writel
	ldr	r3, [sp, #8]
	cmp	r3, #0
	blt	.L7
	ldr	r0, [r4]
	bl	sdio_release_host
	mov	r0, #0
	b	.L1
.L7:
	ldr	r0, [r4]
	bl	sdio_release_irq
.L4:
	ldr	r0, [r4]
	bl	sdio_disable_func
.L2:
	ldr	r0, [r4]
	bl	sdio_release_host
	ldr	r0, [sp, #8]
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r1, .L14+72
	ldr	r0, [r4, #4]
	bl	bt_dev_err
	b	.L4
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC1
	.word	C_FW_OWN_REQ_CLR
	.word	MTK_REG_CHLPCR
	.word	btmtksdio_drv_own_query
	.word	1000000
	.word	C_INT_EN_CLR
	.word	MTK_REG_CHIER
	.word	btmtksdio_interrupt
	.word	MTK_SDIO_BLOCK_SIZE
	.word	SDIO_INT_CTL
	.word	SDIO_RE_INIT_EN
	.word	MTK_REG_CSDIOCSR
	.word	C_INT_CLR_CTRL
	.word	MTK_REG_CHCR
	.word	RX_DONE_INT
	.word	TX_EMPTY
	.word	TX_FIFO_OVERFLOW
	.word	C_INT_EN_SET
	.word	.LC0
	.size	btmtksdio_open, .-btmtksdio_open
	.comm	btmtksdio_interrupt,4,4
	.comm	btmtksdio_drv_own_query,4,4
	.comm	TX_FIFO_OVERFLOW,4,4
	.comm	TX_EMPTY,4,4
	.comm	SDIO_RE_INIT_EN,4,4
	.comm	SDIO_INT_CTL,4,4
	.comm	RX_DONE_INT,4,4
	.comm	MTK_SDIO_BLOCK_SIZE,4,4
	.comm	MTK_REG_CSDIOCSR,4,4
	.comm	MTK_REG_CHLPCR,4,4
	.comm	MTK_REG_CHIER,4,4
	.comm	MTK_REG_CHCR,4,4
	.comm	C_INT_EN_SET,4,4
	.comm	C_INT_EN_CLR,4,4
	.comm	C_INT_CLR_CTRL,4,4
	.comm	C_FW_OWN_REQ_CLR,4,4
	.comm	C_COM_DRV_OWN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
