Commit 4216d502 authored by Enrico Scholz's avatar Enrico Scholz

media:mx6s_capture: swapped initialization order in streamon()

vb2_streamon() expects that sensors provides data and timeouts else.
s_stream must be called to downstream devices hence to start streaming.
Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
parent 754da569
......@@ -1704,13 +1704,17 @@ static int mx6s_vidioc_streamon(struct file *file, void *priv,
if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
ret = vb2_streamon(&csi_dev->vb2_vidq, i);
ret = v4l2_subdev_call(sd, video, s_stream, 1);
if (ret < 0)
goto out;
ret = v4l2_subdev_call(sd, video, s_stream, 1);
if (ret < 0)
vb2_streamoff(&csi_dev->vb2_vidq, i);
ret = vb2_streamon(&csi_dev->vb2_vidq, i);
if (ret < 0) {
v4l2_subdev_call(sd, video, s_stream, 0);
goto out;
}
ret = 0;
out:
return ret;
......@@ -1721,6 +1725,7 @@ static int mx6s_vidioc_streamoff(struct file *file, void *priv,
{
struct mx6s_csi_dev *csi_dev = video_drvdata(file);
struct v4l2_subdev *sd = csi_dev->sd;
int rc;
if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
......@@ -1729,11 +1734,16 @@ static int mx6s_vidioc_streamoff(struct file *file, void *priv,
* This calls buf_release from host driver's videobuf_queue_ops for all
* remaining buffers. When the last buffer is freed, stop capture
*/
vb2_streamoff(&csi_dev->vb2_vidq, i);
rc = vb2_streamoff(&csi_dev->vb2_vidq, i);
if (rc < 0)
goto out;
v4l2_subdev_call(sd, video, s_stream, 0);
return 0;
rc = 0;
out:
return rc;
}
static int mx6s_vidioc_cropcap(struct file *file, void *fh,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment