aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2011-02-11 06:08:06 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-14 11:10:57 -0500
commit54a8c500d5b80c83e0f14cbcfcfd4a84abff8a80 (patch)
tree2292d77a630dec193a5682e6238d73b7c09a8cd9 /sound/usb/quirks.c
parentdf8d81a32fa0309d64726fc62d83cb70adc899e8 (diff)
ALSA: usb-audio: add support for Native Instruments MK2 devices
The MK2 generation of Native Instruments' sound cards are in fact compliant to the USB audio standard of version 2 and other approved USB standards. However, they come up as vendor-specific device when first connected but can be told to come up with a new set of descriptors upon their next enumeration. The interfaces announced by the new descriptors will be handled by the kernel's class drivers. This is done by issuing a vendor specific device request and sending the device to reset. There are also some vendor-specific USB requests for some mixer elements that can't be exported in a standard compliant way. The driver now supports them with quirks handling mechanisms. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index cf8bf088394b..e55bd1cac77d 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -425,6 +425,34 @@ static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
425} 425}
426 426
427/* 427/*
428 * Some sound cards from Native Instruments are in fact compliant to the USB
429 * audio standard of version 2 and other approved USB standards, even though
430 * they come up as vendor-specific device when first connected.
431 *
432 * However, they can be told to come up with a new set of descriptors
433 * upon their next enumeration, and the interfaces announced by the new
434 * descriptors will then be handled by the kernel's class drivers. As the
435 * product ID will also change, no further checks are required.
436 */
437
438static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
439{
440 int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
441 0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
442 cpu_to_le16(1), 0, NULL, 0, 1000);
443
444 if (ret < 0)
445 return ret;
446
447 usb_reset_device(dev);
448
449 /* return -EAGAIN, so the creation of an audio interface for this
450 * temporary device is aborted. The device will reconnect with a
451 * new product ID */
452 return -EAGAIN;
453}
454
455/*
428 * Setup quirks 456 * Setup quirks
429 */ 457 */
430#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */ 458#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */
@@ -510,6 +538,11 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
510 if (id == USB_ID(0x133e, 0x0815)) 538 if (id == USB_ID(0x133e, 0x0815))
511 return snd_usb_accessmusic_boot_quirk(dev); 539 return snd_usb_accessmusic_boot_quirk(dev);
512 540
541 /* Native Instruments Devices */
542 if (id == USB_ID(0x17cc, 0x1010) || /* Traktor Audio 6 */
543 id == USB_ID(0x17cc, 0x1020)) /* Traktor Audio 10 */
544 return snd_usb_nativeinstruments_boot_quirk(dev);
545
513 return 0; 546 return 0;
514} 547}
515 548