diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-27 12:32:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:43 -0500 |
commit | 6a18eaf61aadcd7f002ddfa26031525570e6f8b6 (patch) | |
tree | d842e20066095d51171eb4db3aed464bd0ae5485 /drivers/media/video/em28xx/em28xx-video.c | |
parent | 017ab4b1e2aa31dc9fe986ab6d1f5ffa2a84395b (diff) |
V4L/DVB (9766): em28xx: improve probe messages
Prints usb speed used by em28xx interface. While there, fixes USB ID's
endiannes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index efa4c825322..a0db340e5eb 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -2176,6 +2176,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
2176 | struct em28xx *dev = NULL; | 2176 | struct em28xx *dev = NULL; |
2177 | int retval = -ENODEV; | 2177 | int retval = -ENODEV; |
2178 | int i, nr, ifnum, isoc_pipe; | 2178 | int i, nr, ifnum, isoc_pipe; |
2179 | char *speed; | ||
2179 | 2180 | ||
2180 | udev = usb_get_dev(interface_to_usbdev(interface)); | 2181 | udev = usb_get_dev(interface_to_usbdev(interface)); |
2181 | ifnum = interface->altsetting[0].desc.bInterfaceNumber; | 2182 | ifnum = interface->altsetting[0].desc.bInterfaceNumber; |
@@ -2186,11 +2187,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
2186 | 2187 | ||
2187 | /* Don't register audio interfaces */ | 2188 | /* Don't register audio interfaces */ |
2188 | if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { | 2189 | if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { |
2189 | em28xx_err(DRIVER_NAME " audio device (%04x:%04x): interface %i, class %i\n", | 2190 | em28xx_err(DRIVER_NAME " audio device (%04x:%04x): " |
2190 | udev->descriptor.idVendor, | 2191 | "interface %i, class %i\n", |
2191 | udev->descriptor.idProduct, | 2192 | le16_to_cpu(udev->descriptor.idVendor), |
2192 | ifnum, | 2193 | le16_to_cpu(udev->descriptor.idProduct), |
2193 | interface->altsetting[0].desc.bInterfaceClass); | 2194 | ifnum, |
2195 | interface->altsetting[0].desc.bInterfaceClass); | ||
2194 | 2196 | ||
2195 | em28xx_devused &= ~(1<<nr); | 2197 | em28xx_devused &= ~(1<<nr); |
2196 | return -ENODEV; | 2198 | return -ENODEV; |
@@ -2219,8 +2221,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
2219 | if (!check_interface) { | 2221 | if (!check_interface) { |
2220 | em28xx_err(DRIVER_NAME " video device (%04x:%04x): " | 2222 | em28xx_err(DRIVER_NAME " video device (%04x:%04x): " |
2221 | "interface %i, class %i found.\n", | 2223 | "interface %i, class %i found.\n", |
2222 | udev->descriptor.idVendor, | 2224 | le16_to_cpu(udev->descriptor.idVendor), |
2223 | udev->descriptor.idProduct, | 2225 | le16_to_cpu(udev->descriptor.idProduct), |
2224 | ifnum, | 2226 | ifnum, |
2225 | interface->altsetting[0].desc.bInterfaceClass); | 2227 | interface->altsetting[0].desc.bInterfaceClass); |
2226 | 2228 | ||
@@ -2230,14 +2232,30 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
2230 | em28xx_devused &= ~(1<<nr); | 2232 | em28xx_devused &= ~(1<<nr); |
2231 | return -ENODEV; | 2233 | return -ENODEV; |
2232 | } | 2234 | } |
2235 | } | ||
2233 | 2236 | ||
2237 | switch (udev->speed) { | ||
2238 | case USB_SPEED_LOW: | ||
2239 | speed = "1.5"; | ||
2240 | break; | ||
2241 | case USB_SPEED_UNKNOWN: | ||
2242 | case USB_SPEED_FULL: | ||
2243 | speed = "12"; | ||
2244 | break; | ||
2245 | case USB_SPEED_HIGH: | ||
2246 | speed = "480"; | ||
2247 | break; | ||
2248 | default: | ||
2249 | speed = "unknown"; | ||
2234 | } | 2250 | } |
2235 | 2251 | ||
2236 | em28xx_err(DRIVER_NAME " new video device (%04x:%04x): interface %i, class %i\n", | 2252 | printk(DRIVER_NAME ": New video device @ %s Mbps " |
2237 | udev->descriptor.idVendor, | 2253 | "(%04x:%04x, interface %d, class %d)\n", |
2238 | udev->descriptor.idProduct, | 2254 | speed, |
2239 | ifnum, | 2255 | le16_to_cpu(udev->descriptor.idVendor), |
2240 | interface->altsetting[0].desc.bInterfaceClass); | 2256 | le16_to_cpu(udev->descriptor.idProduct), |
2257 | ifnum, | ||
2258 | interface->altsetting->desc.bInterfaceNumber); | ||
2241 | 2259 | ||
2242 | if (nr >= EM28XX_MAXBOARDS) { | 2260 | if (nr >= EM28XX_MAXBOARDS) { |
2243 | printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", | 2261 | printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", |