Current uvcvideo driver do not correctly disables stream on
Bulk VideoStream EP. This couse problems on a webcam buildin
to Asus Zenbook UX302LA. For example it will be not disabled
and can't be strated after usb port was suspended.

Since usb_set_interface can be used only on Iso EP. We need some
way to handle Bulk VS EP.
Widnwos (xp - 8) uvcvideo driver use usb_clear_halt
in this case. It seems to be correct way to hadle Bulk and Int EPs.
And it solves this problem on UX302LA ultrabook.

CC: [email protected]
Signed-off-by: Oleksij Rempel <[email protected]>
---
 drivers/media/usb/uvc/uvc_video.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 898c208..9d335c0 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1847,7 +1847,15 @@ int uvc_video_enable(struct uvc_streaming *stream, int 
enable)
 
        if (!enable) {
                uvc_uninit_video(stream, 1);
-               usb_set_interface(stream->dev->udev, stream->intfnum, 0);
+               if (stream->intf->num_altsetting > 1) {
+                       usb_set_interface(stream->dev->udev,
+                                         stream->intfnum, 0);
+               } else {
+                       usb_clear_halt(stream->dev->udev,
+                               usb_rcvctrlpipe(stream->dev->udev,
+                                               stream->intfnum));
+               }
+
                uvc_queue_enable(&stream->queue, 0);
                uvc_video_clock_cleanup(stream);
                return 0;
-- 
1.9.rc1

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to