summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-03-19 09:55:22 +0100
committerJean-Francois Moine <moinejf@free.fr>2009-03-19 09:55:22 +0100
commit4d2f7316ade12329d6431989db0f367d7806eb87 (patch)
tree437a20a722f93366f325777ea67a0bb7f2349335 /linux/drivers
parentb06321e32a39a1462e511309762821ae740914f7 (diff)
downloadmediapointer-dvb-s2-4d2f7316ade12329d6431989db0f367d7806eb87.tar.gz
mediapointer-dvb-s2-4d2f7316ade12329d6431989db0f367d7806eb87.tar.bz2
gspca - main: May have isochronous transfers on altsetting 0.
From: Jean-Francois Moine <moinejf@free.fr> Priority: normal Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/gspca/gspca.c12
-rw-r--r--linux/drivers/media/video/gspca/gspca.h1
2 files changed, 8 insertions, 5 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index d629ce1dc..88de8b865 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -486,14 +486,14 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
i = gspca_dev->alt; /* previous alt setting */
/* try isoc */
- while (--i > 0) { /* alt 0 is unusable */
+ while (--i >= 0) {
ep = alt_xfer(&intf->altsetting[i],
USB_ENDPOINT_XFER_ISOC);
if (ep)
break;
}
- /* if no isoc, try bulk */
+ /* if no isoc, try bulk (alt 0 only) */
if (ep == NULL) {
ep = alt_xfer(&intf->altsetting[0],
USB_ENDPOINT_XFER_BULK);
@@ -501,6 +501,8 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
err("no transfer endpoint found");
return NULL;
}
+ i = 0;
+ gspca_dev->bulk = 1;
}
PDEBUG(D_STREAM, "use alt %d ep 0x%02x",
i, ep->desc.bEndpointAddress);
@@ -527,7 +529,7 @@ static int create_urbs(struct gspca_dev *gspca_dev,
/* calculate the packet size and the number of packets */
psize = le16_to_cpu(ep->desc.wMaxPacketSize);
- if (gspca_dev->alt != 0) { /* isoc */
+ if (!gspca_dev->bulk) { /* isoc */
/* See paragraph 5.9 / table 5-11 of the usb 2.0 spec. */
psize = (psize & 0x07ff) * (1 + ((psize >> 11) & 3));
@@ -627,7 +629,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
goto out;
/* clear the bulk endpoint */
- if (gspca_dev->alt == 0) /* if bulk transfer */
+ if (gspca_dev->bulk)
usb_clear_halt(gspca_dev->dev,
gspca_dev->urb[0]->pipe);
@@ -640,7 +642,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
gspca_dev->streaming = 1;
/* some bulk transfers are started by the subdriver */
- if (gspca_dev->alt == 0 && gspca_dev->cam.bulk_nurbs == 0)
+ if (gspca_dev->bulk && gspca_dev->cam.bulk_nurbs == 0)
break;
/* submit the URBs */
diff --git a/linux/drivers/media/video/gspca/gspca.h b/linux/drivers/media/video/gspca/gspca.h
index 6f172e9e5..e4d4cf6ce 100644
--- a/linux/drivers/media/video/gspca/gspca.h
+++ b/linux/drivers/media/video/gspca/gspca.h
@@ -167,6 +167,7 @@ struct gspca_dev {
__u8 iface; /* USB interface number */
__u8 alt; /* USB alternate setting */
__u8 nbalt; /* number of USB alternate settings */
+ u8 bulk; /* image transfer by 0:isoc / 1:bulk */
};
int gspca_dev_probe(struct usb_interface *intf,