	.file	"extr_tw5864-video.c_tw5864_enable_input.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Enabling channel %d\n"
	.text
	.p2align 4
	.type	tw5864_enable_input, @function
tw5864_enable_input:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	rsi, .LC0[rip]
	mov	r15d, 120
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, 479
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, 239
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rbp, QWORD PTR 104[rdi]
	mov	r12d, DWORD PTR [rdi]
	mov	rdi, QWORD PTR 8[rbp]
	mov	edx, r12d
	call	dev_dbg@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	rdx, QWORD PTR lambda_lookup_table[rip]
	mov	QWORD PTR 96[rbx], 0
	mov	QWORD PTR 88[rbx], 0
	mov	esi, 1
	mov	edx, DWORD PTR [rdx+rax*4]
	mov	QWORD PTR 8[rbx], rax
	mov	QWORD PTR 80[rbx], 0
	mov	DWORD PTR 72[rbx], edx
	mov	rdx, QWORD PTR intra4x4_lambda3[rip]
	mov	eax, DWORD PTR [rdx+rax*4]
	mov	rdx, QWORD PTR 40[rbx]
	mov	DWORD PTR 32[rbx], 130
	mov	DWORD PTR 48[rbx], 720
	mov	DWORD PTR 68[rbx], eax
	mov	eax, DWORD PTR TW5864_EMU_EN_LPF[rip]
	or	eax, DWORD PTR TW5864_EMU_EN_BHOST[rip]
	or	eax, DWORD PTR TW5864_EMU_EN_SEN[rip]
	or	eax, DWORD PTR TW5864_EMU_EN_ME[rip]
	or	eax, DWORD PTR TW5864_EMU_EN_DDR[rip]
	mov	ecx, eax
	mov	eax, DWORD PTR TW5864_DSP_MB_DELAY[rip]
	and	eax, 2560
	or	eax, DWORD PTR TW5864_DSP_CHROM_SW[rip]
	or	eax, r12d
	cmp	rdx, QWORD PTR STD_NTSC[rip]
	mov	edx, 576
	mov	DWORD PTR 28[rbx], eax
	mov	eax, 575
	cmovne	r14d, eax
	mov	eax, 287
	cmovne	r13d, eax
	mov	eax, 144
	cmovne	r15d, eax
	mov	eax, 480
	cmovne	eax, edx
	mov	DWORD PTR 52[rbx], eax
	mov	eax, DWORD PTR TW5864_CIF_MAP_MD[rip]
	or	eax, DWORD PTR TW5864_HD1_MAP_MD[rip]
	or	DWORD PTR 60[rbx], eax
	mov	eax, DWORD PTR TW5864_DSP_FRAME_TYPE_D1[rip]
	or	eax, ecx
	mov	ecx, r12d
	mov	DWORD PTR 24[rbx], eax
	mov	eax, DWORD PTR TW5864_DI_EN[rip]
	sal	esi, cl
	or	eax, DWORD PTR TW5864_DSP_INTER_ST[rip]
	mov	DWORD PTR 56[rbx], eax
	mov	edi, DWORD PTR TW5864_FULL_HALF_FLAG[rip]
	call	tw_setl@PLT
	mov	edi, r12d
	call	TW5864_INDIR_IN_PIC_WIDTH@PLT
	mov	esi, 180
	mov	edi, eax
	call	tw_indir_writeb@PLT
	mov	edi, r12d
	call	TW5864_INDIR_IN_PIC_HEIGHT@PLT
	mov	esi, r15d
	mov	edi, eax
	call	tw_indir_writeb@PLT
	mov	esi, DWORD PTR 48[rbx]
	mov	edi, r12d
	test	esi, esi
	lea	r15d, 3[rsi]
	cmovns	r15d, esi
	call	TW5864_INDIR_OUT_PIC_WIDTH@PLT
	sar	r15d, 2
	mov	edi, eax
	mov	esi, r15d
	call	tw_indir_writeb@PLT
	mov	esi, DWORD PTR 52[rbx]
	mov	edi, r12d
	test	esi, esi
	lea	r15d, 3[rsi]
	cmovns	r15d, esi
	call	TW5864_INDIR_OUT_PIC_HEIGHT@PLT
	sar	r15d, 2
	mov	edi, eax
	mov	esi, r15d
	call	tw_indir_writeb@PLT
	mov	DWORD PTR 48[rbx], 704
	mov	edi, DWORD PTR TW5864_INDIR_CROP_ETC[rip]
	call	tw_indir_readb@PLT
	mov	edi, DWORD PTR TW5864_INDIR_CROP_ETC[rip]
	or	eax, DWORD PTR TW5864_INDIR_CROP_ETC_CROP_EN[rip]
	mov	esi, eax
	call	tw_indir_writeb@PLT
	mov	eax, DWORD PTR 48[rbx]
	mov	edx, DWORD PTR 52[rbx]
	mov	edi, DWORD PTR TW5864_DSP_PIC_MAX_MB[rip]
	test	eax, eax
	lea	esi, 15[rax]
	cmovns	esi, eax
	lea	eax, 15[rdx]
	sar	esi, 4
	sal	esi, 8
	test	edx, edx
	cmovns	eax, edx
	sar	eax, 4
	or	esi, eax
	call	tw_writel@PLT
	mov	edi, r12d
	call	TW5864_FRAME_WIDTH_BUS_A@PLT
	mov	esi, 719
	mov	edi, eax
	call	tw_writel@PLT
	mov	edi, r12d
	call	TW5864_FRAME_WIDTH_BUS_B@PLT
	mov	esi, 719
	mov	edi, eax
	call	tw_writel@PLT
	mov	edi, r12d
	call	TW5864_FRAME_HEIGHT_BUS_A@PLT
	mov	esi, r14d
	mov	edi, eax
	call	tw_writel@PLT
	mov	edi, r12d
	call	TW5864_FRAME_HEIGHT_BUS_B@PLT
	mov	esi, r13d
	mov	edi, eax
	call	tw_writel@PLT
	mov	rdi, rbx
	call	tw5864_frame_interval_set@PLT
	xor	ecx, ecx
	lea	edx, [r12+r12]
	mov	esi, 3
	mov	edi, DWORD PTR TW5864_H264EN_CH_FMT_REG1[rip]
	call	tw_mask_shift_writel@PLT
	xor	ecx, ecx
	mov	edx, r12d
	mov	esi, 31
	mov	rax, QWORD PTR STD_NTSC[rip]
	cmp	QWORD PTR 40[rbx], rax
	sete	cl
	shr	edx, 31
	lea	eax, [r12+rdx]
	lea	ecx, 24[rcx+rcx*4]
	and	eax, 1
	sub	eax, edx
	lea	edx, [rax+rax*4]
	lea	r13d, 0[0+rax*8]
	cmp	r12d, 1
	jle	.L10
	mov	edi, DWORD PTR TW5864_H264EN_RATE_MAX_LINE_REG2[rip]
	call	tw_mask_shift_writel@PLT
	mov	edi, DWORD PTR TW5864_FRAME_BUS2[rip]
.L5:
	mov	edx, r13d
	mov	ecx, 28
	xor	r12d, r12d
	mov	esi, 255
	call	tw_mask_shift_writel@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	DWORD PTR 64[rbx], 1
	mov	rsi, r12
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	edi, DWORD PTR TW5864_H264EN_RATE_MAX_LINE_REG1[rip]
	call	tw_mask_shift_writel@PLT
	mov	edi, DWORD PTR TW5864_FRAME_BUS1[rip]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	tw5864_enable_input, .-tw5864_enable_input
	.comm	lambda_lookup_table,8,8
	.comm	intra4x4_lambda3,8,8
	.comm	TW5864_INDIR_CROP_ETC_CROP_EN,4,4
	.comm	TW5864_INDIR_CROP_ETC,4,4
	.comm	TW5864_HD1_MAP_MD,4,4
	.comm	TW5864_H264EN_RATE_MAX_LINE_REG2,4,4
	.comm	TW5864_H264EN_RATE_MAX_LINE_REG1,4,4
	.comm	TW5864_H264EN_CH_FMT_REG1,4,4
	.comm	TW5864_H264EN_CH_DNS,4,4
	.comm	TW5864_FULL_HALF_FLAG,4,4
	.comm	TW5864_FRAME_BUS2,4,4
	.comm	TW5864_FRAME_BUS1,4,4
	.comm	TW5864_EMU_EN_SEN,4,4
	.comm	TW5864_EMU_EN_ME,4,4
	.comm	TW5864_EMU_EN_LPF,4,4
	.comm	TW5864_EMU_EN_DDR,4,4
	.comm	TW5864_EMU_EN_BHOST,4,4
	.comm	TW5864_DSP_PIC_MAX_MB,4,4
	.comm	TW5864_DSP_MB_DELAY,4,4
	.comm	TW5864_DSP_INTER_ST,4,4
	.comm	TW5864_DSP_FRAME_TYPE_D1,4,4
	.comm	TW5864_DSP_CHROM_SW,4,4
	.comm	TW5864_DI_EN,4,4
	.comm	TW5864_CIF_MAP_MD,4,4
	.comm	STD_NTSC,8,8
	.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_tw5864-video.c_tw5864_enable_input.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Enabling channel %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tw5864_enable_input, %function
tw5864_enable_input:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r5, [r0]
	ldr	r6, [r0, #68]
	ldr	r7, .L20
	mov	r2, r5
	ldr	r1, .L20+4
	ldr	r0, [r6, #4]
	bl	dev_dbg
	ldr	r2, [r4, #24]
	ldr	r3, [r7]
	ldr	r0, .L20+8
	cmp	r2, r3
	ldr	r2, .L20+12
	ldr	r3, [r4, #8]
	ldr	r10, [r2]
	ldr	r2, .L20+16
	ldr	r0, [r0]
	ldr	r2, [r2]
	ldr	r0, [r0, r3, lsl #2]
	orr	r2, r10, r2
	ldr	r10, .L20+20
	str	r0, [r4, #52]
	ldr	r10, [r10]
	ldr	r0, .L20+24
	orr	r2, r2, r10
	ldr	r0, [r0]
	ldr	r10, .L20+28
	ldr	r0, [r0, r3, lsl #2]
	str	r3, [r4, #4]
	ldr	r3, [r10]
	ldr	r10, .L20+32
	mov	lr, #720
	ldr	r10, [r10]
	str	r0, [r4, #48]
	ldr	r0, .L20+36
	mov	r9, #130
	orr	r2, r2, r10
	ldr	r10, [r0]
	moveq	ip, #480
	movne	ip, #576
	and	r3, r3, #2560
	mov	r8, #0
	orr	r3, r3, r10
	mov	r1, #1
	ldr	r10, .L20+40
	ldr	r0, .L20+44
	ldr	fp, [r10]
	ldr	r0, [r0]
	ldr	r10, .L20+48
	orr	r0, r0, fp
	moveq	fp, #120
	movne	fp, #144
	ldr	r10, [r10]
	orr	r3, r3, r5
	orr	r2, r2, r10
	ldr	r10, .L20+52
	str	r3, [r4, #16]
	ldr	r10, [r10]
	str	lr, [r4, #28]
	orr	r2, r10, r2
	ldr	lr, [r4, #40]
	ldr	r10, .L20+56
	ldr	r3, .L20+60
	orr	r0, lr, r0
	ldr	r3, [r3]
	str	r9, [r4, #20]
	ldr	r9, [r10]
	str	r0, [r4, #40]
	ldr	r0, .L20+64
	orr	r3, r3, r9
	str	ip, [r4, #32]
	ldr	ip, .L20+68
	str	r2, [r4, #12]
	lsl	r1, r1, r5
	str	r8, [r4, #64]
	str	r8, [r4, #60]
	str	r8, [r4, #56]
	str	r3, [r4, #36]
	ldr	r0, [r0]
	ldr	r10, .L20+72
	ldr	r9, .L20+76
	movne	r10, ip
	moveq	r9, #239
	bl	tw_setl
	mov	r0, r5
	bl	TW5864_INDIR_IN_PIC_WIDTH
	mov	r1, #180
	bl	tw_indir_writeb
	mov	r0, r5
	bl	TW5864_INDIR_IN_PIC_HEIGHT
	mov	r1, fp
	bl	tw_indir_writeb
	mov	r0, r5
	bl	TW5864_INDIR_OUT_PIC_WIDTH
	ldr	r1, [r4, #28]
	cmp	r1, r8
	add	r3, r1, #3
	movlt	r1, r3
	asr	r1, r1, #2
	bl	tw_indir_writeb
	mov	r0, r5
	bl	TW5864_INDIR_OUT_PIC_HEIGHT
	ldr	r1, [r4, #32]
	cmp	r1, r8
	add	r3, r1, #3
	movlt	r1, r3
	asr	r1, r1, #2
	bl	tw_indir_writeb
	mov	r2, #704
	ldr	r3, .L20+80
	str	r2, [r4, #28]
	ldr	fp, [r3]
	mov	r0, fp
	bl	tw_indir_readb
	mov	r1, r0
	ldr	r3, .L20+84
	mov	r0, fp
	ldr	r3, [r3]
	orr	r1, r1, r3
	bl	tw_indir_writeb
	ldr	r1, [r4, #28]
	ldr	r2, [r4, #32]
	cmp	r1, r8
	add	r0, r1, #15
	movlt	r1, r0
	add	r3, r2, #15
	cmp	r2, r8
	movlt	r2, r3
	ldr	r3, .L20+88
	asr	r2, r2, #4
	asr	r1, r1, #4
	orr	r1, r2, r1, lsl #8
	ldr	r0, [r3]
	bl	tw_writel
	mov	r0, r5
	bl	TW5864_FRAME_WIDTH_BUS_A
	ldr	r1, .L20+92
	bl	tw_writel
	mov	r0, r5
	bl	TW5864_FRAME_WIDTH_BUS_B
	ldr	r1, .L20+92
	bl	tw_writel
	mov	r0, r5
	bl	TW5864_FRAME_HEIGHT_BUS_A
	mov	r1, r10
	bl	tw_writel
	mov	r0, r5
	bl	TW5864_FRAME_HEIGHT_BUS_B
	mov	r1, r9
	bl	tw_writel
	mov	r0, r4
	bl	tw5864_frame_interval_set
	ldr	r1, .L20+96
	mov	r3, r8
	ldr	r0, [r1]
	lsl	r2, r5, #1
	mov	r1, #3
	bl	tw_mask_shift_writel
	cmp	r5, r8
	and	r8, r5, #1
	rsblt	r8, r8, #0
	cmp	r5, #1
	ldr	r1, [r7]
	ldr	r0, [r4, #24]
	add	r2, r8, r8, lsl #2
	ble	.L17
	ldr	r3, .L20+100
	cmp	r0, r1
	ldr	r0, [r3]
	beq	.L18
	mov	r3, #24
	mov	r1, #31
	bl	tw_mask_shift_writel
.L10:
	ldr	r3, .L20+104
	ldr	r0, [r3]
.L8:
	mov	r5, #0
	lsl	r2, r8, #3
	mov	r3, #28
	mov	r1, #255
	bl	tw_mask_shift_writel
	mov	r1, r5
	mov	r0, r6
	bl	spin_lock_irqsave
	mov	r3, #1
	mov	r1, r5
	mov	r0, r6
	str	r3, [r4, #44]
	bl	spin_unlock_irqrestore
	mov	r0, r5
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	mov	r3, #29
	mov	r1, #31
	bl	tw_mask_shift_writel
	b	.L10
.L17:
	ldr	r3, .L20+108
	cmp	r0, r1
	ldr	r0, [r3]
	beq	.L19
	mov	r3, #24
	mov	r1, #31
	bl	tw_mask_shift_writel
.L9:
	ldr	r3, .L20+112
	ldr	r0, [r3]
	b	.L8
.L19:
	mov	r3, #29
	mov	r1, #31
	bl	tw_mask_shift_writel
	b	.L9
.L21:
	.align	2
.L20:
	.word	STD_NTSC
	.word	.LC0
	.word	lambda_lookup_table
	.word	TW5864_EMU_EN_LPF
	.word	TW5864_EMU_EN_BHOST
	.word	TW5864_EMU_EN_SEN
	.word	intra4x4_lambda3
	.word	TW5864_DSP_MB_DELAY
	.word	TW5864_EMU_EN_ME
	.word	TW5864_DSP_CHROM_SW
	.word	TW5864_HD1_MAP_MD
	.word	TW5864_CIF_MAP_MD
	.word	TW5864_EMU_EN_DDR
	.word	TW5864_DSP_FRAME_TYPE_D1
	.word	TW5864_DSP_INTER_ST
	.word	TW5864_DI_EN
	.word	TW5864_FULL_HALF_FLAG
	.word	575
	.word	479
	.word	287
	.word	TW5864_INDIR_CROP_ETC
	.word	TW5864_INDIR_CROP_ETC_CROP_EN
	.word	TW5864_DSP_PIC_MAX_MB
	.word	719
	.word	TW5864_H264EN_CH_FMT_REG1
	.word	TW5864_H264EN_RATE_MAX_LINE_REG2
	.word	TW5864_FRAME_BUS2
	.word	TW5864_H264EN_RATE_MAX_LINE_REG1
	.word	TW5864_FRAME_BUS1
	.size	tw5864_enable_input, .-tw5864_enable_input
	.comm	lambda_lookup_table,4,4
	.comm	intra4x4_lambda3,4,4
	.comm	TW5864_INDIR_CROP_ETC_CROP_EN,4,4
	.comm	TW5864_INDIR_CROP_ETC,4,4
	.comm	TW5864_HD1_MAP_MD,4,4
	.comm	TW5864_H264EN_RATE_MAX_LINE_REG2,4,4
	.comm	TW5864_H264EN_RATE_MAX_LINE_REG1,4,4
	.comm	TW5864_H264EN_CH_FMT_REG1,4,4
	.comm	TW5864_H264EN_CH_DNS,4,4
	.comm	TW5864_FULL_HALF_FLAG,4,4
	.comm	TW5864_FRAME_BUS2,4,4
	.comm	TW5864_FRAME_BUS1,4,4
	.comm	TW5864_EMU_EN_SEN,4,4
	.comm	TW5864_EMU_EN_ME,4,4
	.comm	TW5864_EMU_EN_LPF,4,4
	.comm	TW5864_EMU_EN_DDR,4,4
	.comm	TW5864_EMU_EN_BHOST,4,4
	.comm	TW5864_DSP_PIC_MAX_MB,4,4
	.comm	TW5864_DSP_MB_DELAY,4,4
	.comm	TW5864_DSP_INTER_ST,4,4
	.comm	TW5864_DSP_FRAME_TYPE_D1,4,4
	.comm	TW5864_DSP_CHROM_SW,4,4
	.comm	TW5864_DI_EN,4,4
	.comm	TW5864_CIF_MAP_MD,4,4
	.comm	STD_NTSC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
