Example #1
0
static int fimc_lite_hw_init(struct fimc_lite *fimc)
{
	struct fimc_pipeline *pipeline = &fimc->pipeline;
	struct fimc_sensor_info *sensor;
	unsigned long flags;

	if (pipeline->subdevs[IDX_SENSOR] == NULL)
		return -ENXIO;

	if (fimc->fmt == NULL)
		return -EINVAL;

	sensor = v4l2_get_subdev_hostdata(pipeline->subdevs[IDX_SENSOR]);
	spin_lock_irqsave(&fimc->slock, flags);

	flite_hw_set_camera_bus(fimc, &sensor->pdata);
	flite_hw_set_source_format(fimc, &fimc->inp_frame);
	flite_hw_set_window_offset(fimc, &fimc->inp_frame);
	flite_hw_set_output_dma(fimc, &fimc->out_frame, true);
	flite_hw_set_interrupt_mask(fimc);
	flite_hw_set_test_pattern(fimc, fimc->test_pattern->val);

	if (debug > 0)
		flite_hw_dump_regs(fimc, __func__);

	spin_unlock_irqrestore(&fimc->slock, flags);
	return 0;
}
Example #2
0
/* Must be called  with fimc.slock spinlock held. */
static void fimc_lite_config_update(struct fimc_lite *fimc)
{
	flite_hw_set_window_offset(fimc, &fimc->inp_frame);
	flite_hw_set_dma_window(fimc, &fimc->out_frame);
	flite_hw_set_test_pattern(fimc, fimc->test_pattern->val);
	clear_bit(ST_FLITE_CONFIG, &fimc->state);
}
Example #3
0
static int fimc_lite_hw_init(struct fimc_lite *fimc, bool isp_output)
{
	struct fimc_source_info *si;
	unsigned long flags;

	if (fimc->sensor == NULL)
		return -ENXIO;

	if (fimc->inp_frame.fmt == NULL || fimc->out_frame.fmt == NULL)
		return -EINVAL;

	/* Get sensor configuration data from the sensor subdev */
	si = v4l2_get_subdev_hostdata(fimc->sensor);
	if (!si)
		return -EINVAL;

	spin_lock_irqsave(&fimc->slock, flags);

	flite_hw_set_camera_bus(fimc, si);
	flite_hw_set_source_format(fimc, &fimc->inp_frame);
	flite_hw_set_window_offset(fimc, &fimc->inp_frame);
	flite_hw_set_dma_buf_mask(fimc, 0);
	flite_hw_set_output_dma(fimc, &fimc->out_frame, !isp_output);
	flite_hw_set_interrupt_mask(fimc);
	flite_hw_set_test_pattern(fimc, fimc->test_pattern->val);

	if (debug > 0)
		flite_hw_dump_regs(fimc, __func__);

	spin_unlock_irqrestore(&fimc->slock, flags);
	return 0;
}