Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124185
b: refs/heads/master
c: 95ea470
h: refs/heads/master
i:
  124183: 76cf67a
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 5b9b55e commit a08cad9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 492404449532e40b5b6ed06b56aae2bf710239e6
refs/heads/master: 95ea4705746f52e17f1f14f9136ea2106ffe3b26
36 changes: 23 additions & 13 deletions trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
struct usb_interface *uif;
struct em28xx *dev = NULL;
int retval = -ENODEV;
int i, nr, ifnum;
int i, nr, ifnum, isoc_pipe;

udev = usb_get_dev(interface_to_usbdev(interface));
ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Expand All @@ -2176,19 +2176,29 @@ static int em28xx_usb_probe(struct usb_interface *interface,
ifnum,
interface->altsetting[0].desc.bInterfaceClass);

endpoint = &interface->cur_altsetting->endpoint[1].desc;
endpoint = &interface->cur_altsetting->endpoint[0].desc;

/* check if the device has the iso in endpoint at the correct place */
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
USB_ENDPOINT_XFER_ISOC) {
em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n");
em28xx_devused &= ~(1<<nr);
return -ENODEV;
}
if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {
em28xx_err(DRIVER_NAME " probing error: endpoint is ISO OUT endpoint!\n");
em28xx_devused &= ~(1<<nr);
return -ENODEV;
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC &&
(interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940))
{
/* It's a newer em2874/em2875 device */
isoc_pipe = 0;
} else {
isoc_pipe = 1;
endpoint = &interface->cur_altsetting->endpoint[1].desc;
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
USB_ENDPOINT_XFER_ISOC) {
em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n");
em28xx_devused &= ~(1<<nr);
return -ENODEV;
}
if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {
em28xx_err(DRIVER_NAME " probing error: endpoint is ISO OUT endpoint!\n");
em28xx_devused &= ~(1<<nr);
return -ENODEV;
}
}

if (nr >= EM28XX_MAXBOARDS) {
Expand Down Expand Up @@ -2239,7 +2249,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
}

for (i = 0; i < dev->num_alt ; i++) {
u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[1].desc.
u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.
wMaxPacketSize);
dev->alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
Expand Down

0 comments on commit a08cad9

Please sign in to comment.