Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
---
=20
drivers/media/usb/uvc/uvc_video.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
=20
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb/uvc/uvc_video.c index 103cd4e..29147fd 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1850,7 +1850,19 @@ int uvc_video_enable(struct uvc_streaming *s=
tream,
int enable)
=09if (!enable) {
=09=09uvc_uninit_video(stream, 1);
-=09=09usb_set_interface(stream->dev->udev, stream->intfnum, 0);
+=09=09if (stream->intf->num_altsetting > 1) {
+=09=09=09usb_set_interface(stream->dev->udev,
+=09=09=09=09=09 stream->intfnum, 0);
+=09=09} else {
+=09=09=09/* UVC doesn't specify how to inform a bulk-based device
+=09=09=09 * when the video stream is stopped. Windows sends a
+=09=09=09 * CLEAR_FEATURE(HALT) request to the video streaming
+=09=09=09 * bulk endpoint, mimic the same behaviour.
+=09=09=09 */
+=09=09=09usb_clear_halt(stream->dev->udev,
+=09=09=09=09 stream->header.bEndpointAddress);
Could you please replace that with

unsigned int epnum =3D stream->header.bEndpointAddress
& USB_ENDPOINT_NUMBER_MASK;
unsigned int dir =3D stream->header.bEndpointAddress
& USB_ENDPOINT_DIR_MASK;
unsigned int pipe;

pipe =3D usb_sndbulkpipe(stream->dev->udev, epnum) | di=
r;
usb_clear_halt(stream->dev->udev, pipe);

and retest ?

(As a side note, usb_clear_halt() should really take an endpoint addres=
s as=20
argument, not a pipe, the code would become much simpler...)
+=09=09}
+
=09=09uvc_queue_enable(&stream->queue, 0);
=09=09uvc_video_clock_cleanup(stream);
=09=09return 0;
=2D-=20
Regards,

Laurent Pinchart

--nextPart3507442.2XCXs5EQi1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAABAgAGBQJTDSCmAAoJEIkPb2GL7hl1NZ4H/RZTFkHAp6J0uJMrVGe7IZje
6QkQqAWIzaGu/E5mdk5v6Vh4ORs+fiEbQCVcUKm/NaVMpliPHvOPF27n5yS/OPZV
bFx8cpim/5ma5ekVaPDfhZY1A0qJk7XIrB5olbJX0XGl0HGvuptif71mDh5jjO4b
OHtdpBErf++ZPMz+aMQFs3VrtMRg5ix+R013gmi7/mL8vQxce0NVSSecaV+7A4Qn
n74BvDAPExi4gRl0GIuzH6Q49eM8iMT8XA0ClXqOnsJuZdDXdWUQxV0DKaKqHgci
9nCySO4ni0lvZn4RSR6p5LEfvpjf0nMuRuxG9BplySWHQL3EUv/UZtkY9sz/vAY=
=GiUg
-----END PGP SIGNATURE-----

--nextPart3507442.2XCXs5EQi1--

Loading...