void flite_hw_set_dma_addr(u32 __iomem *base_reg, u32 number, bool use, u32 addr)
{
	/* dma addr set */
	if (use) {
		flite_hw_set_start_addr(base_reg, number, addr);
		flite_hw_set_use_buffer(base_reg, number);
		flite_hw_set_output_dma(base_reg, true);
	} else {
	/* dma addr set */
		flite_hw_set_unuse_buffer(base_reg, number);
		flite_hw_set_start_addr(base_reg, number, 0);
		flite_hw_set_output_dma(base_reg, false);
	}
}
int init_fimc_lite(unsigned long mipi_reg_base)
{
	int i;

	writel(0, mipi_reg_base + FLITE_REG_CIFCNTSEQ);

	for (i = 0; i < 32; i++)
		flite_hw_set_start_addr(mipi_reg_base , i, 0xffffffff);

	return 0;
}
static int init_fimc_lite(u32 __iomem *base_reg)
{
	int i;

	writel(0, base_reg + TO_WORD_OFFSET(FLITE_REG_CH1FCNTSEQ));

	for (i = 0; i < 32; i++)
		flite_hw_set_start_addr(base_reg , i, 0xffffffff);

	return 0;
}
static void tasklet_func_flite_end(unsigned long data)
{
	struct fimc_is_device_flite *flite;
	struct fimc_is_device_sensor *sensor;
	struct fimc_is_framemgr *framemgr;
	struct fimc_is_frame_shot *frame;
	u32 index, bdone;
	u32 fcount;

	flite = (struct fimc_is_device_flite *)data;
	sensor = (struct fimc_is_device_sensor *)flite->private_data;
	framemgr = flite->framemgr;
	bdone = flite->tasklet_param_end;

	fcount = atomic_read(&flite->fcount);

#ifdef DBG_STREAMING
	printk(KERN_INFO "E%d %d\n", bdone, fcount);
#endif

	framemgr_e_barrier(framemgr, FMGR_IDX_1 + bdone);
	spin_lock(&flite->slock_state);

	if (test_bit(bdone, &flite->state)) {
		fimc_is_frame_process_head(framemgr, &frame);
		if (frame) {
#ifdef MEASURE_TIME
#ifndef INTERNAL_TIME
			do_gettimeofday(&frame->tzone[TM_FLITE_END]);
#endif
#endif
			index = frame->index;
			fimc_is_frame_trans_pro_to_com(framemgr, frame);

#ifdef AUTO_MODE
			if (!work_pending(&flite->work_queue)) {
				flite->work = index;
				schedule_work(&flite->work_queue);
			} else {
				struct fimc_is_device_ischain *ischain;
				ischain = sensor->ischain;

				frame->shot_ext->request_scc = 0;
				frame->shot_ext->request_scp = 0;
				buffer_done(flite->video, index);
				err("work pending, %d frame drop", index);
				fimc_is_frame_print_all(ischain->framemgr);
			}
#else
			buffer_done(flite->video, index);
#endif
			fimc_is_frame_request_head(framemgr, &frame);
			if (frame) {
				flite_hw_set_start_addr(flite->regs, bdone,
					frame->dvaddr_buffer[0]);
				set_bit(bdone, &flite->state);
				fimc_is_frame_trans_req_to_pro(framemgr, frame);
			} else {
				flite_hw_set_unuse_buffer(flite->regs, bdone);
				clear_bit(bdone, &flite->state);
#ifdef TASKLET_MSG
				err("request shot is empty0(%d slot)", bdone);
#endif
				fimc_is_frame_print_all(framemgr);

				/*this is debugging ponit for deadlock*/
				/*
				fimc_is_ischain_print_status(sensor->ischain);
				*/
			}
		} else {
#ifdef TASKLET_MSG
			err("process shot is empty(state is invalid(%d, %ld))",
				bdone, flite->state);
#endif
			fimc_is_frame_print_all(framemgr);
		}
	} else {
		fimc_is_frame_request_head(framemgr, &frame);
		if (frame) {
			flite_hw_set_start_addr(flite->regs, bdone,
				frame->dvaddr_buffer[0]);
			flite_hw_set_use_buffer(flite->regs, bdone);
			set_bit(bdone, &flite->state);
			fimc_is_frame_trans_req_to_pro(framemgr, frame);
		} else {
#ifdef TASKLET_MSG
			err("request shot is empty1(%d slot)", bdone);
#endif
			fimc_is_frame_print_all(framemgr);
		}
	}

	spin_unlock(&flite->slock_state);
	framemgr_x_barrier(framemgr, FMGR_IDX_1 + bdone);
}