[media] gspca - main: Fix the isochronous transfer interval
authorJean-François Moine <moinejf@free.fr>
Wed, 10 Aug 2011 10:28:44 +0000 (07:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 11 Sep 2011 12:27:05 +0000 (09:27 -0300)
For USB speeds different of 'low', the bInterval value is logarithmic.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index a3c2d36..85d2469 100644 (file)
@@ -754,7 +754,10 @@ static int create_urbs(struct gspca_dev *gspca_dev,
                                                    ep->desc.bEndpointAddress);
                        urb->transfer_flags = URB_ISO_ASAP
                                        | URB_NO_TRANSFER_DMA_MAP;
-                       urb->interval = ep->desc.bInterval;
+                       if (gspca_dev->dev->speed == USB_SPEED_LOW)
+                               urb->interval = ep->desc.bInterval;
+                       else
+                               urb->interval = 1 << (ep->desc.bInterval - 1);
                        urb->complete = isoc_irq;
                        urb->number_of_packets = npkt;
                        for (i = 0; i < npkt; i++) {