[media] em28xx: make sure that the device has video
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 29 Jan 2016 14:53:56 +0000 (12:53 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 1 Feb 2016 09:28:17 +0000 (07:28 -0200)
There are some devices, like Terratec Cinergy HTC, where
while the device supports analog TV, the driver is not
capable yet of handling it, because the analog TV driver
was not written.

So, don't bind the em28xx-v4l drivers on such devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/em28xx/em28xx-cards.c

index 2001c9c1478414e4945b6a123e23aec261572e28..ec4e951198774b24546d199bff2a0d5bc5595c5e 100644 (file)
@@ -3468,7 +3468,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
        /* save our data pointer in this interface device */
        usb_set_intfdata(interface, dev);
 
-       /* allocate device struct */
+       /* allocate device struct and check if the device is a webcam */
        mutex_init(&dev->lock);
        retval = em28xx_init_dev(dev, udev, interface, nr);
        if (retval) {
@@ -3484,6 +3484,15 @@ static int em28xx_usb_probe(struct usb_interface *interface,
                try_bulk = usb_xfer_mode > 0;
        }
 
+       /* Disable V4L2 if the device doesn't have a decoder */
+       if (has_video &&
+           dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) {
+               printk(DRIVER_NAME
+                      ": Currently, V4L2 is not supported on this model\n");
+               has_video = false;
+               dev->has_video = false;
+       }
+
        /* Select USB transfer types to use */
        if (has_video) {
                if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
This page took 0.027769 seconds and 5 git commands to generate.