diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-10-13 17:11:35 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-25 13:39:14 +0300 |
commit | b83bba24a29c44b696b5977e3874bc07b13dc3c0 (patch) | |
tree | 0379cb6f3b164dc253713c14e9246d7acee5af43 /drivers/media/usb/uvc/uvc_video.c | |
parent | aa3d17df6470338223f7ae6893647453e8f8e98e (diff) | |
download | linux-b83bba24a29c44b696b5977e3874bc07b13dc3c0.tar.xz |
[media] uvcvideo: Separate video and queue enable/disable operations
In order to make use of the vb2 queue start/stop_streaming operations
the video and queue enable/disable operations need to be split, as the
vb2 queue will need to enable and disable video instead of the other way
around.
Also move buffer queue disable outside of uvc_video_resume() to remove
all queue disable operations out of uvc_video.c.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_video.c')
-rw-r--r-- | drivers/media/usb/uvc/uvc_video.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index b9c7dee8e7b3..9637e8b86949 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1735,19 +1735,13 @@ int uvc_video_resume(struct uvc_streaming *stream, int reset) uvc_video_clock_reset(stream); ret = uvc_commit_video(stream, &stream->ctrl); - if (ret < 0) { - uvc_queue_enable(&stream->queue, 0); + if (ret < 0) return ret; - } if (!uvc_queue_streaming(&stream->queue)) return 0; - ret = uvc_init_video(stream, GFP_NOIO); - if (ret < 0) - uvc_queue_enable(&stream->queue, 0); - - return ret; + return uvc_init_video(stream, GFP_NOIO); } /* ------------------------------------------------------------------------ @@ -1779,11 +1773,6 @@ int uvc_video_init(struct uvc_streaming *stream) atomic_set(&stream->active, 0); - /* Initialize the video buffers queue. */ - ret = uvc_queue_init(&stream->queue, stream->type, !uvc_no_drop_param); - if (ret) - return ret; - /* Alternate setting 0 should be the default, yet the XBox Live Vision * Cam (and possibly other devices) crash or otherwise misbehave if * they don't receive a SET_INTERFACE request before any other video @@ -1890,7 +1879,6 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable) usb_clear_halt(stream->dev->udev, pipe); } - uvc_queue_enable(&stream->queue, 0); uvc_video_clock_cleanup(stream); return 0; } @@ -1899,10 +1887,6 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable) if (ret < 0) return ret; - ret = uvc_queue_enable(&stream->queue, 1); - if (ret < 0) - goto error_queue; - /* Commit the streaming parameters. */ ret = uvc_commit_video(stream, &stream->ctrl); if (ret < 0) @@ -1917,8 +1901,6 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable) error_video: usb_set_interface(stream->dev->udev, stream->intfnum, 0); error_commit: - uvc_queue_enable(&stream->queue, 0); -error_queue: uvc_video_clock_cleanup(stream); return ret; |