/* Note: Resetting the camera FIFO via the CC_RST bit in the CC_CTRL register is supposed to be sufficient to recover from a camera interface error, but it doesn't seem to be enough. If we only do that then subsequent image captures are out of sync by either one or two times DMA_THRESHOLD bytes. Resetting and re-initializing the entire camera subsystem prevents the problem with frame synchronization.  */
static void omap24xxcam_capture_cont(struct omap24xxcam_device *cam)
/* Note: Resetting the camera FIFO via the CC_RST bit in the CC_CTRL register is supposed to be sufficient to recover from a camera interface error, but it doesn't seem to be enough. If we only do that then subsequent image captures are out of sync by either one or two times DMA_THRESHOLD bytes. Resetting and re-initializing the entire camera subsystem prevents the problem with frame synchronization.  */
static void omap24xxcam_capture_cont(struct omap24xxcam_device *cam)
{
	unsigned long flags;
	spin_lock_irqsave(&cam->core_enable_disable_lock, flags);
	if (atomic_read(&cam->in_reset) != 1)
		goto out;
	omap24xxcam_hwinit(cam);
	omap24xxcam_sensor_if_enable(cam);
	omap24xxcam_sgdma_process(&cam->sgdma);
	if (cam->sgdma_in_queue)
		omap24xxcam_core_enable(cam);
out:
	atomic_dec(&cam->in_reset);
	spin_unlock_irqrestore(&cam->core_enable_disable_lock, flags);
}