aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorMark Hills <mark@xwax.org>2013-03-17 07:07:53 -0400
committerTakashi Iwai <tiwai@suse.de>2013-03-18 03:46:18 -0400
commit5e212332cc7eed0ffbf91fbe5bab6e2a44b83de6 (patch)
treeb967bb0d8b676e03a6d01761a561dcb7877794b7 /sound/usb
parentba615b86d6a3ba6e244973672c63903c8b2831a3 (diff)
ALSA: usb-audio: Playback and MIDI support for Novation Twitch DJ controller
The hardware also has a PCM capture device which is not implemented in this patch. It may be possible to generalise this to Saffire 6 USB support and some of the other Focusrite interfaces, but as I don't have access to these devices we should wait until capture support is working first. Capture support is not implemented because the code assumes the endpoint to have its own interface (instead, it shares the interface with playback) and some thought will be needed to lift this limitation. Signed-off-by: Mark Hills <mark@xwax.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/quirks-table.h40
-rw-r--r--sound/usb/quirks.c15
2 files changed, 55 insertions, 0 deletions
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index c39f898b15d2..a620c239caed 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2748,6 +2748,46 @@ YAMAHA_DEVICE(0x7010, "UB99"),
2748 } 2748 }
2749}, 2749},
2750{ 2750{
2751 USB_DEVICE(0x1235, 0x0018),
2752 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2753 .vendor_name = "Novation",
2754 .product_name = "Twitch",
2755 .ifnum = QUIRK_ANY_INTERFACE,
2756 .type = QUIRK_COMPOSITE,
2757 .data = (const struct snd_usb_audio_quirk[]) {
2758 {
2759 .ifnum = 0,
2760 .type = QUIRK_AUDIO_FIXED_ENDPOINT,
2761 .data = & (const struct audioformat) {
2762 .formats = SNDRV_PCM_FMTBIT_S24_3LE,
2763 .channels = 4,
2764 .iface = 0,
2765 .altsetting = 1,
2766 .altset_idx = 1,
2767 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
2768 .endpoint = 0x01,
2769 .ep_attr = USB_ENDPOINT_XFER_ISOC,
2770 .rates = SNDRV_PCM_RATE_44100 |
2771 SNDRV_PCM_RATE_48000,
2772 .rate_min = 44100,
2773 .rate_max = 48000,
2774 .nr_rates = 2,
2775 .rate_table = (unsigned int[]) {
2776 44100, 48000
2777 }
2778 }
2779 },
2780 {
2781 .ifnum = 1,
2782 .type = QUIRK_MIDI_RAW_BYTES
2783 },
2784 {
2785 .ifnum = -1
2786 }
2787 }
2788 }
2789},
2790{
2751 USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661), 2791 USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661),
2752 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 2792 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2753 .vendor_name = "Novation", 2793 .vendor_name = "Novation",
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 5325a3869bb7..7c4fe5a634f0 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -446,6 +446,17 @@ static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
446} 446}
447 447
448/* 448/*
449 * Novation Twitch DJ controller
450 */
451static int snd_usb_twitch_boot_quirk(struct usb_device *dev)
452{
453 /* preemptively set up the device because otherwise the
454 * raw MIDI endpoints are not active */
455 usb_set_interface(dev, 0, 1);
456 return 0;
457}
458
459/*
449 * This call will put the synth in "USB send" mode, i.e it will send MIDI 460 * This call will put the synth in "USB send" mode, i.e it will send MIDI
450 * messages through USB (this is disabled at startup). The synth will 461 * messages through USB (this is disabled at startup). The synth will
451 * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB 462 * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB
@@ -746,6 +757,10 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
746 /* Digidesign Mbox 2 */ 757 /* Digidesign Mbox 2 */
747 return snd_usb_mbox2_boot_quirk(dev); 758 return snd_usb_mbox2_boot_quirk(dev);
748 759
760 case USB_ID(0x1235, 0x0018):
761 /* Focusrite Novation Twitch */
762 return snd_usb_twitch_boot_quirk(dev);
763
749 case USB_ID(0x133e, 0x0815): 764 case USB_ID(0x133e, 0x0815):
750 /* Access Music VirusTI Desktop */ 765 /* Access Music VirusTI Desktop */
751 return snd_usb_accessmusic_boot_quirk(dev); 766 return snd_usb_accessmusic_boot_quirk(dev);