aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 9da812b8a786..71fa51e7984e 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2246,7 +2246,7 @@ struct em28xx_board em28xx_boards[] = {
2246}; 2246};
2247EXPORT_SYMBOL_GPL(em28xx_boards); 2247EXPORT_SYMBOL_GPL(em28xx_boards);
2248 2248
2249const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); 2249static const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
2250 2250
2251/* table of devices that work with this driver */ 2251/* table of devices that work with this driver */
2252struct usb_device_id em28xx_id_table[] = { 2252struct usb_device_id em28xx_id_table[] = {
@@ -2931,9 +2931,9 @@ static void request_module_async(struct work_struct *work)
2931#if defined(CONFIG_MODULES) && defined(MODULE) 2931#if defined(CONFIG_MODULES) && defined(MODULE)
2932 if (dev->has_video) 2932 if (dev->has_video)
2933 request_module("em28xx-v4l"); 2933 request_module("em28xx-v4l");
2934 if (dev->has_audio_class) 2934 if (dev->usb_audio_type == EM28XX_USB_AUDIO_CLASS)
2935 request_module("snd-usb-audio"); 2935 request_module("snd-usb-audio");
2936 else if (dev->has_alsa_audio) 2936 else if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR)
2937 request_module("em28xx-alsa"); 2937 request_module("em28xx-alsa");
2938 if (dev->board.has_dvb) 2938 if (dev->board.has_dvb)
2939 request_module("em28xx-dvb"); 2939 request_module("em28xx-dvb");
@@ -3098,16 +3098,6 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
3098 } 3098 }
3099 } 3099 }
3100 3100
3101 if (dev->chip_id == CHIP_ID_EM2870 ||
3102 dev->chip_id == CHIP_ID_EM2874 ||
3103 dev->chip_id == CHIP_ID_EM28174 ||
3104 dev->chip_id == CHIP_ID_EM28178) {
3105 /* Digital only device - don't load any alsa module */
3106 dev->audio_mode.has_audio = false;
3107 dev->has_audio_class = false;
3108 dev->has_alsa_audio = false;
3109 }
3110
3111 if (chip_name != default_chip_name) 3101 if (chip_name != default_chip_name)
3112 printk(KERN_INFO DRIVER_NAME 3102 printk(KERN_INFO DRIVER_NAME
3113 ": chip ID is %s\n", chip_name); 3103 ": chip ID is %s\n", chip_name);
@@ -3190,7 +3180,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3190 struct usb_device *udev; 3180 struct usb_device *udev;
3191 struct em28xx *dev = NULL; 3181 struct em28xx *dev = NULL;
3192 int retval; 3182 int retval;
3193 bool has_audio = false, has_video = false, has_dvb = false; 3183 bool has_vendor_audio = false, has_video = false, has_dvb = false;
3194 int i, nr, try_bulk; 3184 int i, nr, try_bulk;
3195 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber; 3185 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
3196 char *speed; 3186 char *speed;
@@ -3272,7 +3262,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3272 break; 3262 break;
3273 case 0x83: 3263 case 0x83:
3274 if (usb_endpoint_xfer_isoc(e)) { 3264 if (usb_endpoint_xfer_isoc(e)) {
3275 has_audio = true; 3265 has_vendor_audio = true;
3276 } else { 3266 } else {
3277 printk(KERN_INFO DRIVER_NAME 3267 printk(KERN_INFO DRIVER_NAME
3278 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); 3268 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
@@ -3328,7 +3318,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3328 } 3318 }
3329 } 3319 }
3330 3320
3331 if (!(has_audio || has_video || has_dvb)) { 3321 if (!(has_vendor_audio || has_video || has_dvb)) {
3332 retval = -ENODEV; 3322 retval = -ENODEV;
3333 goto err_free; 3323 goto err_free;
3334 } 3324 }
@@ -3375,26 +3365,27 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3375 dev->devno = nr; 3365 dev->devno = nr;
3376 dev->model = id->driver_info; 3366 dev->model = id->driver_info;
3377 dev->alt = -1; 3367 dev->alt = -1;
3378 dev->is_audio_only = has_audio && !(has_video || has_dvb); 3368 dev->is_audio_only = has_vendor_audio && !(has_video || has_dvb);
3379 dev->has_alsa_audio = has_audio;
3380 dev->audio_mode.has_audio = has_audio;
3381 dev->has_video = has_video; 3369 dev->has_video = has_video;
3382 dev->ifnum = ifnum; 3370 dev->ifnum = ifnum;
3383 3371
3384 /* Checks if audio is provided by some interface */ 3372 if (has_vendor_audio) {
3373 printk(KERN_INFO DRIVER_NAME ": Audio interface %i found %s\n",
3374 ifnum, "(Vendor Class)");
3375 dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
3376 }
3377 /* Checks if audio is provided by a USB Audio Class interface */
3385 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { 3378 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
3386 struct usb_interface *uif = udev->config->interface[i]; 3379 struct usb_interface *uif = udev->config->interface[i];
3387 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { 3380 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3388 dev->has_audio_class = 1; 3381 if (has_vendor_audio)
3382 em28xx_err("em28xx: device seems to have vendor AND usb audio class interfaces !\n"
3383 "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n");
3384 dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
3389 break; 3385 break;
3390 } 3386 }
3391 } 3387 }
3392 3388
3393 if (has_audio)
3394 printk(KERN_INFO DRIVER_NAME
3395 ": Audio interface %i found %s\n",
3396 ifnum,
3397 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)");
3398 if (has_video) 3389 if (has_video)
3399 printk(KERN_INFO DRIVER_NAME 3390 printk(KERN_INFO DRIVER_NAME
3400 ": Video interface %i found:%s%s\n", 3391 ": Video interface %i found:%s%s\n",