diff options
author | Aviv Greenberg <aviv.d.greenberg@intel.com> | 2014-09-02 02:16:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-27 07:39:17 -0500 |
commit | 9fae30acdeefb8955c9f90d4d18a3d1dc599a1ff (patch) | |
tree | c37555433cce6e07edf9e6fddbd0ee70cd8ef8aa | |
parent | 533ab2231d15e082f4ef547ee2fe99a8a25ab046 (diff) |
[media] uvcvideo: Remove extra commit on resume()
The UVC spec is a bit vague wrt devices using bulk endpoints,
specifically, how to signal to a device to start streaming.
For devices using isoc endpoints, the sequence for start streaming is:
1) The host sends PROBE_CONTROL(SET_CUR) PROBE_CONTROL(GET_CUR)
2) Host selects desired config and calls COMMIT_CONTROL(SET_CUR)
3) Host selects an alt interface other then zero - e.g SELECT_ALTERNATE_INTERFACE(1)
4) The device starts streaming
However for devices using bulk endpoints, there must be *no* alt interface
other than setting zero. From the UVC spec:
"A VideoStreaming interface containing a bulk endpoint for streaming shall
support only alternate setting zero. Additional alternate settings containing
bulk endpoints are not permitted in a device that is compliant with the Video
Class specification."
So for devices using bulk endpoints, step #3 above is irrelevant, and thus
cannot be used as an indication for the device to start streaming.
So in practice, such devices start streaming immediately after a
COMMIT_CONTROL(SET_CUR).
In the uvc resume() handler, an unsolicited commit is sent, which causes
devices using bulk endpoints to start streaming unintentionally.
This patch modifies resume() handler to send a commit only if streaming
needs to be reestablished, i.e if the device was actually streaming before is
was suspended.
Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/uvc/uvc_video.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 9637e8b86949..20ccc9d315dc 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c | |||
@@ -1734,13 +1734,13 @@ int uvc_video_resume(struct uvc_streaming *stream, int reset) | |||
1734 | 1734 | ||
1735 | uvc_video_clock_reset(stream); | 1735 | uvc_video_clock_reset(stream); |
1736 | 1736 | ||
1737 | if (!uvc_queue_streaming(&stream->queue)) | ||
1738 | return 0; | ||
1739 | |||
1737 | ret = uvc_commit_video(stream, &stream->ctrl); | 1740 | ret = uvc_commit_video(stream, &stream->ctrl); |
1738 | if (ret < 0) | 1741 | if (ret < 0) |
1739 | return ret; | 1742 | return ret; |
1740 | 1743 | ||
1741 | if (!uvc_queue_streaming(&stream->queue)) | ||
1742 | return 0; | ||
1743 | |||
1744 | return uvc_init_video(stream, GFP_NOIO); | 1744 | return uvc_init_video(stream, GFP_NOIO); |
1745 | } | 1745 | } |
1746 | 1746 | ||