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>
This commit is contained in:
Daniel Mack
2011-02-11 11:08:06 +00:00
committed by Takashi Iwai
parent df8d81a32f
commit 54a8c500d5
3 changed files with 200 additions and 0 deletions

View File

@@ -424,6 +424,34 @@ static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
return 0;
}
/*
* Some sound cards from Native Instruments are in fact compliant to the USB
* audio standard of version 2 and other approved USB standards, even though
* they come up as vendor-specific device when first connected.
*
* However, they can be told to come up with a new set of descriptors
* upon their next enumeration, and the interfaces announced by the new
* descriptors will then be handled by the kernel's class drivers. As the
* product ID will also change, no further checks are required.
*/
static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
{
int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
cpu_to_le16(1), 0, NULL, 0, 1000);
if (ret < 0)
return ret;
usb_reset_device(dev);
/* return -EAGAIN, so the creation of an audio interface for this
* temporary device is aborted. The device will reconnect with a
* new product ID */
return -EAGAIN;
}
/*
* Setup quirks
*/
@@ -510,6 +538,11 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
if (id == USB_ID(0x133e, 0x0815))
return snd_usb_accessmusic_boot_quirk(dev);
/* Native Instruments Devices */
if (id == USB_ID(0x17cc, 0x1010) || /* Traktor Audio 6 */
id == USB_ID(0x17cc, 0x1020)) /* Traktor Audio 10 */
return snd_usb_nativeinstruments_boot_quirk(dev);
return 0;
}