diff mbox

ALSA: usb-audio: Add MIDI support for Steinberg MI2/MI4

Message ID 1435246006-5333-1-git-send-email-dominic.sacre@gmx.de (mailing list archive)
State New, archived
Headers show

Commit Message

Dominic Sacré June 25, 2015, 3:26 p.m. UTC
The Steinberg MI2 and MI4 interfaces are compatible with the USB class
audio spec, but the MIDI part of the devices is reported as a vendor
specific interface.

This patch adds entries to quirks-table.h to recognize the MIDI
endpoints. Audio functionality was already working and is unaffected by
this change.

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Albert Huitsing <albert@huitsing.nl>
---
 sound/usb/quirks-table.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Clemens Ladisch June 25, 2015, 6:23 p.m. UTC | #1
Dominic Sacré wrote:
> The Steinberg MI2 and MI4 interfaces are compatible with the USB class
> audio spec, but the MIDI part of the devices is reported as a vendor
> specific interface.
>
> This patch adds entries to quirks-table.h to recognize the MIDI
> endpoints. Audio functionality was already working and is unaffected by
> this change.
>
> Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
> Signed-off-by: Albert Huitsing <albert@huitsing.nl>
> ---
>  sound/usb/quirks-table.h | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>
> diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
> index 2f6d3e9..304c02a 100644
> --- a/sound/usb/quirks-table.h
> +++ b/sound/usb/quirks-table.h
> @@ -3152,6 +3152,49 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
>  },
>
>  {
> +	/* Steinberg MI2 */
> +	USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x2040),
> +	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> +		.ifnum = QUIRK_ANY_INTERFACE,
> +		.type = QUIRK_COMPOSITE,
> +		.data = & (const struct snd_usb_audio_quirk[]) {
> +			{
> +				.ifnum = 3,
> +				.type = QUIRK_MIDI_FIXED_ENDPOINT,
> +				.data = &(const struct snd_usb_midi_endpoint_info) {
> +					.out_cables = 0x0001,
> +					.in_cables  = 0x0001
> +				}
> +			},
> +			{
> +				.ifnum = -1
> +			}
> +		}
> +	}

Please add entries for the other interfaces.  Without them, interface
zero will not be attached, and the other interface are not handled
atomically.

And in theory, the device entries are supposed to be sorted by ID.


Regards,
Clemens
diff mbox

Patch

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 2f6d3e9..304c02a 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3152,6 +3152,49 @@  AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
 },
 
 {
+	/* Steinberg MI2 */
+	USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x2040),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 3,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = &(const struct snd_usb_midi_endpoint_info) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+{
+	/* Steinberg MI4 */
+	USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x4040),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 3,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = &(const struct snd_usb_midi_endpoint_info) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
+{
 	/*
 	 * Some USB MIDI devices don't have an audio control interface,
 	 * so we have to grab MIDI streaming interfaces here.