Commit 95ea4705 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (9587): Handle changes to endpoint layout in em2874

Empia moved around their endpoint configuration in newer chips, so accommodate
the changes

Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: default avatarDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 49240444
...@@ -2149,7 +2149,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -2149,7 +2149,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
struct usb_interface *uif; struct usb_interface *uif;
struct em28xx *dev = NULL; struct em28xx *dev = NULL;
int retval = -ENODEV; int retval = -ENODEV;
int i, nr, ifnum; int i, nr, ifnum, isoc_pipe;
udev = usb_get_dev(interface_to_usbdev(interface)); udev = usb_get_dev(interface_to_usbdev(interface));
ifnum = interface->altsetting[0].desc.bInterfaceNumber; ifnum = interface->altsetting[0].desc.bInterfaceNumber;
...@@ -2176,19 +2176,29 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -2176,19 +2176,29 @@ static int em28xx_usb_probe(struct usb_interface *interface,
ifnum, ifnum,
interface->altsetting[0].desc.bInterfaceClass); 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 */ /* check if the device has the iso in endpoint at the correct place */
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC) { USB_ENDPOINT_XFER_ISOC &&
em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n"); (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940))
em28xx_devused &= ~(1<<nr); {
return -ENODEV; /* It's a newer em2874/em2875 device */
} isoc_pipe = 0;
if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { } else {
em28xx_err(DRIVER_NAME " probing error: endpoint is ISO OUT endpoint!\n"); isoc_pipe = 1;
em28xx_devused &= ~(1<<nr); endpoint = &interface->cur_altsetting->endpoint[1].desc;
return -ENODEV; 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) { if (nr >= EM28XX_MAXBOARDS) {
...@@ -2239,7 +2249,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -2239,7 +2249,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
} }
for (i = 0; i < dev->num_alt ; i++) { 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); wMaxPacketSize);
dev->alt_max_pkt_size[i] = dev->alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment