aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2008-11-12 00:02:17 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:32 -0500
commit95ea4705746f52e17f1f14f9136ea2106ffe3b26 (patch)
treebc490a203900e5150709019ef452be6623733000
parent492404449532e40b5b6ed06b56aae2bf710239e6 (diff)
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: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index e8edeecf367d..e478ccba0378 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -2149,7 +2149,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2149 struct usb_interface *uif; 2149 struct usb_interface *uif;
2150 struct em28xx *dev = NULL; 2150 struct em28xx *dev = NULL;
2151 int retval = -ENODEV; 2151 int retval = -ENODEV;
2152 int i, nr, ifnum; 2152 int i, nr, ifnum, isoc_pipe;
2153 2153
2154 udev = usb_get_dev(interface_to_usbdev(interface)); 2154 udev = usb_get_dev(interface_to_usbdev(interface));
2155 ifnum = interface->altsetting[0].desc.bInterfaceNumber; 2155 ifnum = interface->altsetting[0].desc.bInterfaceNumber;
@@ -2176,19 +2176,29 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2176 ifnum, 2176 ifnum,
2177 interface->altsetting[0].desc.bInterfaceClass); 2177 interface->altsetting[0].desc.bInterfaceClass);
2178 2178
2179 endpoint = &interface->cur_altsetting->endpoint[1].desc; 2179 endpoint = &interface->cur_altsetting->endpoint[0].desc;
2180 2180
2181 /* check if the device has the iso in endpoint at the correct place */ 2181 /* check if the device has the iso in endpoint at the correct place */
2182 if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != 2182 if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
2183 USB_ENDPOINT_XFER_ISOC) { 2183 USB_ENDPOINT_XFER_ISOC &&
2184 em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n"); 2184 (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940))
2185 em28xx_devused &= ~(1<<nr); 2185 {
2186 return -ENODEV; 2186 /* It's a newer em2874/em2875 device */
2187 } 2187 isoc_pipe = 0;
2188 if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { 2188 } else {
2189 em28xx_err(DRIVER_NAME " probing error: endpoint is ISO OUT endpoint!\n"); 2189 isoc_pipe = 1;
2190 em28xx_devused &= ~(1<<nr); 2190 endpoint = &interface->cur_altsetting->endpoint[1].desc;
2191 return -ENODEV; 2191 if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
2192 USB_ENDPOINT_XFER_ISOC) {
2193 em28xx_err(DRIVER_NAME " probing error: endpoint is non-ISO endpoint!\n");
2194 em28xx_devused &= ~(1<<nr);
2195 return -ENODEV;
2196 }
2197 if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {
2198 em28xx_err(DRIVER_NAME " probing error: endpoint is ISO OUT endpoint!\n");
2199 em28xx_devused &= ~(1<<nr);
2200 return -ENODEV;
2201 }
2192 } 2202 }
2193 2203
2194 if (nr >= EM28XX_MAXBOARDS) { 2204 if (nr >= EM28XX_MAXBOARDS) {
@@ -2239,7 +2249,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2239 } 2249 }
2240 2250
2241 for (i = 0; i < dev->num_alt ; i++) { 2251 for (i = 0; i < dev->num_alt ; i++) {
2242 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[1].desc. 2252 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.
2243 wMaxPacketSize); 2253 wMaxPacketSize);
2244 dev->alt_max_pkt_size[i] = 2254 dev->alt_max_pkt_size[i] =
2245 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 2255 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);