summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlex Gonzalez <alex.gonzalez@digi.com>2011-10-21 14:25:28 +0200
committerAlex Gonzalez <alex.gonzalez@digi.com>2011-10-24 14:34:28 +0200
commitd3a98b142679038b9d0fd5340f9739948a959123 (patch)
treea7e6fbe23721d773008fa39eefbe318cf47f280d /drivers
parent5b05c072b8ba2e9866ac6db37aff175727633b7a (diff)
MXC V4L2 capture: Do not always reset buffer queues on mxc_streamoff
We need to call mxc_streamoff on suspend, otherwise the CSI_MEM0 DMA channel (15) will not be disabled and the IPU clock will be left enabled on suspend. That will make the target not react to wake up events. However, we don't want mxc_streamoff to reinitialize the buffer queues as the application will desynchronize. This is part of a set of fixes for #40007.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/capture/mxc_v4l2_capture.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
index 45d9b1faa674..002b6021446e 100644
--- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
@@ -440,11 +440,11 @@ static int mxc_streamon(cam_data *cam)
*
* @return status 0 Success
*/
-static int mxc_streamoff(cam_data *cam)
+static int mxc_streamoff(cam_data *cam , int suspend)
{
int err = 0;
- pr_debug("In MVC:mxc_streamoff\n");
+ pr_debug("In MVC:mxc_streamoff, suspend %d\n",suspend);
if (cam->capture_on == false)
return 0;
@@ -457,9 +457,11 @@ static int mxc_streamoff(cam_data *cam)
if (cam->enc_disable)
err = cam->enc_disable(cam);
- mxc_free_frames(cam);
+ if( !suspend){
+ mxc_free_frames(cam);
+ cam->capture_on = false;
+ }
mxc_capture_inputs[cam->current_input].status |= V4L2_IN_ST_NO_POWER;
- cam->capture_on = false;
return err;
}
@@ -1723,7 +1725,7 @@ static int mxc_v4l_close(struct file *file)
cam->overlay_on = false;
}
if (cam->capture_pid == current->tgid) {
- err |= mxc_streamoff(cam);
+ err |= mxc_streamoff(cam,false);
wake_up_interruptible(&cam->enc_queue);
}
@@ -1981,7 +1983,7 @@ static long mxc_v4l_do_ioctl(struct file *file,
break;
}
- mxc_streamoff(cam);
+ mxc_streamoff(cam,false);
mxc_free_frame_buf(cam);
cam->enc_counter = 0;
INIT_LIST_HEAD(&cam->ready_q);
@@ -2086,7 +2088,7 @@ static long mxc_v4l_do_ioctl(struct file *file,
*/
case VIDIOC_STREAMOFF: {
pr_debug(" case VIDIOC_STREAMOFF\n");
- retval = mxc_streamoff(cam);
+ retval = mxc_streamoff(cam,false);
break;
}
@@ -2322,7 +2324,7 @@ static long mxc_v4l_do_ioctl(struct file *file,
if ((mxc_capture_inputs[cam->current_input].status &
V4L2_IN_ST_NO_POWER) == 0) {
- retval = mxc_streamoff(cam);
+ retval = mxc_streamoff(cam,false);
if (retval)
break;
mxc_capture_inputs[cam->current_input].status |=
@@ -2697,10 +2699,11 @@ static int mxc_v4l2_suspend(struct platform_device *pdev, pm_message_t state)
stop_preview(cam);
if (cam->capture_on == true) {
- mxc_streamoff(cam);
- cam->capture_on = true;
+ mxc_streamoff(cam,true);
}
vidioc_int_s_power(cam->sensor, 0);
+ mxc_capture_inputs[cam->current_input].status |= V4L2_IN_ST_NO_POWER;
+
return 0;
}