static int flite_s_stream(struct v4l2_subdev *sd, int enable) { struct flite_dev *flite = to_flite_dev(sd); u32 index = flite->pdata->active_cam_index; struct s3c_platform_camera *cam = flite->pdata->cam[index]; u32 int_src = FLITE_REG_CIGCTRL_IRQ_LASTEN0_ENABLE; unsigned long flags; int ret = 0; if (enable) flite_hw_reset(flite); spin_lock_irqsave(&flite->slock, flags); if (test_bit(FLITE_ST_SUSPENDED, &flite->state)) goto s_stream_unlock; if (enable) { flite_hw_set_cam_channel(flite); flite_hw_set_cam_source_size(flite); flite_hw_set_camera_type(flite, cam); ret = flite_hw_set_source_format(flite); if (unlikely(ret < 0)) goto s_stream_unlock; if (cam->use_isp) flite_hw_set_output_dma(flite, false); flite_hw_set_interrupt_source(flite, int_src); flite_hw_set_config_irq(flite, cam); flite_hw_set_window_offset(flite); flite_hw_set_capture_start(flite); set_bit(FLITE_ST_STREAMING, &flite->state); } else { if (test_bit(FLITE_ST_STREAMING, &flite->state)) { flite_hw_set_capture_stop(flite); spin_unlock_irqrestore(&flite->slock, flags); ret = wait_event_timeout(flite->irq_queue, !test_bit(FLITE_ST_STREAMING, &flite->state), HZ/20); /* 50 ms */ if (unlikely(!ret)) { v4l2_err(sd, "wait timeout\n"); ret = -EBUSY; } } return ret; } s_stream_unlock: spin_unlock_irqrestore(&flite->slock, flags); return ret; }
int stop_fimc_lite(unsigned long mipi_reg_base) { flite_hw_set_capture_stop(mipi_reg_base); return 0; }
void flite_hw_disable(u32 __iomem *base_reg) { flite_hw_set_capture_stop(base_reg); }