The patch number 9766 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Mauro Carvalho Chehab  <[EMAIL PROTECTED]>
em28xx: improve probe messages


Prints usb speed used by em28xx interface. While there, fixes USB ID's
endiannes.

Priority: normal

Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/em28xx/em28xx-video.c |   48 +++++++++++-----
 1 file changed, 33 insertions(+), 15 deletions(-)

diff -r f255f7e1ca7d -r cf29f09b1e4b 
linux/drivers/media/video/em28xx/em28xx-video.c
--- a/linux/drivers/media/video/em28xx/em28xx-video.c   Thu Nov 27 10:21:55 
2008 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c   Thu Nov 27 15:32:17 
2008 -0200
@@ -2258,6 +2258,7 @@ static int em28xx_usb_probe(struct usb_i
        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_i
 
        /* 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_i
                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_i
                        em28xx_devused &= ~(1<<nr);
                        return -ENODEV;
                }
-
-       }
-
-       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);
+       }
+
+       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";
+       }
+
+       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",


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/cf29f09b1e4b71d649ddecca2fe9a41b5975788d

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to