diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-27 15:32:17 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-27 15:32:17 -0200 |
commit | 1396809fc70840b729f6bdc9ef62e6bcb60825c7 (patch) | |
tree | c23f7d1cc382711894706d7878be4102d05180bb /linux/drivers/media/video/em28xx | |
parent | ed2bce4cb08784c495e2a63775256ea4e2a75300 (diff) | |
download | mediapointer-dvb-s2-1396809fc70840b729f6bdc9ef62e6bcb60825c7.tar.gz mediapointer-dvb-s2-1396809fc70840b729f6bdc9ef62e6bcb60825c7.tar.bz2 |
em28xx: improve probe messages
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Prints usb speed used by em28xx interface. While there, fixes USB ID's
endiannes.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 676240bb1..23507ac4e 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -2258,6 +2258,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, struct em28xx *dev = NULL; int retval = -ENODEV; int i, nr, ifnum, isoc_pipe; + char *speed; udev = usb_get_dev(interface_to_usbdev(interface)); ifnum = interface->altsetting[0].desc.bInterfaceNumber; @@ -2268,11 +2269,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Don't register audio interfaces */ if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { - em28xx_err(DRIVER_NAME " audio device (%04x:%04x): interface %i, class %i\n", - udev->descriptor.idVendor, - udev->descriptor.idProduct, - ifnum, - interface->altsetting[0].desc.bInterfaceClass); + em28xx_err(DRIVER_NAME " audio device (%04x:%04x): " + "interface %i, class %i\n", + le16_to_cpu(udev->descriptor.idVendor), + le16_to_cpu(udev->descriptor.idProduct), + ifnum, + interface->altsetting[0].desc.bInterfaceClass); em28xx_devused &= ~(1<<nr); return -ENODEV; @@ -2301,8 +2303,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (!check_interface) { em28xx_err(DRIVER_NAME " video device (%04x:%04x): " "interface %i, class %i found.\n", - udev->descriptor.idVendor, - udev->descriptor.idProduct, + le16_to_cpu(udev->descriptor.idVendor), + le16_to_cpu(udev->descriptor.idProduct), ifnum, interface->altsetting[0].desc.bInterfaceClass); @@ -2312,14 +2314,30 @@ static int em28xx_usb_probe(struct usb_interface *interface, em28xx_devused &= ~(1<<nr); return -ENODEV; } + } + switch (udev->speed) { + case USB_SPEED_LOW: + speed = "1.5"; + break; + case USB_SPEED_UNKNOWN: + case USB_SPEED_FULL: + speed = "12"; + break; + case USB_SPEED_HIGH: + speed = "480"; + break; + default: + speed = "unknown"; } - em28xx_err(DRIVER_NAME " new video device (%04x:%04x): interface %i, class %i\n", - udev->descriptor.idVendor, - udev->descriptor.idProduct, - ifnum, - interface->altsetting[0].desc.bInterfaceClass); + printk(DRIVER_NAME ": New video device @ %s Mbps " + "(%04x:%04x, interface %d, class %d)\n", + speed, + le16_to_cpu(udev->descriptor.idVendor), + le16_to_cpu(udev->descriptor.idProduct), + ifnum, + interface->altsetting->desc.bInterfaceNumber); if (nr >= EM28XX_MAXBOARDS) { printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", |