提交 f43402fa 编写于 作者: J Jean-François Moine 提交者: Mauro Carvalho Chehab

[media] gspca - main: Fix a regression with the PS3 Eye webcam

When audio is present, some alternate settings were skipped.
This prevented some webcams to work, especially when bulk transfer was used.
This patch permits to use the last or only alternate setting.
Reported-by: NAntonio Ospite <ospite@studenti.unina.it>
Tested-by: NAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: NJean-François Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 3f0a4d29
...@@ -652,7 +652,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) ...@@ -652,7 +652,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
: USB_ENDPOINT_XFER_ISOC; : USB_ENDPOINT_XFER_ISOC;
i = gspca_dev->alt; /* previous alt setting */ i = gspca_dev->alt; /* previous alt setting */
if (gspca_dev->cam.reverse_alts) { if (gspca_dev->cam.reverse_alts) {
if (gspca_dev->audio) if (gspca_dev->audio && i < gspca_dev->nbalt - 2)
i++; i++;
while (++i < gspca_dev->nbalt) { while (++i < gspca_dev->nbalt) {
ep = alt_xfer(&intf->altsetting[i], xfer); ep = alt_xfer(&intf->altsetting[i], xfer);
...@@ -660,7 +660,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) ...@@ -660,7 +660,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
break; break;
} }
} else { } else {
if (gspca_dev->audio) if (gspca_dev->audio && i > 1)
i--; i--;
while (--i >= 0) { while (--i >= 0) {
ep = alt_xfer(&intf->altsetting[i], xfer); ep = alt_xfer(&intf->altsetting[i], xfer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册