ALSA: usb-audio: Skip probe of UA-101 devices
authorTakashi Iwai <tiwai@suse.de>
Thu, 8 Apr 2021 07:56:56 +0000 (09:56 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 9 Apr 2021 07:57:30 +0000 (09:57 +0200)
UA-101 device and co are supported by another driver, snd-ua101, but
the USB audio class driver (snd-usb-audio) catches all and this
resulted in the lack of functionality like missing MIDI devices.

This patch introduces a sort of deny-listing for those devices to just
return -ENODEV at probe in snd-usb-audio driver, so that it falls back
to the probe by snd-ua101.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212477
Link: https://lore.kernel.org/r/20210408075656.30184-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c
sound/usb/quirks-table.h
sound/usb/usbaudio.h

index 7b7526d3a56e88565c601a823a46f918fb8f0e2d..2f6a62416c057466f1c8af82d7621a8e8822714b 100644 (file)
@@ -713,6 +713,8 @@ static int usb_audio_probe(struct usb_interface *intf,
                quirk = get_alias_quirk(dev, id);
        if (quirk && quirk->ifnum >= 0 && ifnum != quirk->ifnum)
                return -ENXIO;
+       if (quirk && quirk->ifnum == QUIRK_NODEV_INTERFACE)
+               return -ENODEV;
 
        err = snd_usb_apply_boot_quirk(dev, intf, quirk, id);
        if (err < 0)
index 9716a9f7c095bfa6bf3f7fa18ab58559fa00d3af..92f525b1c9921c7bacf3653cc1528dff63431d13 100644 (file)
@@ -1674,6 +1674,27 @@ YAMAHA_DEVICE(0x7010, "UB99"),
                }
        }
 },
+
+/* UA101 and co are supported by another driver */
+{
+       USB_DEVICE(0x0582, 0x0044), /* UA-1000 high speed */
+       .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+               .ifnum = QUIRK_NODEV_INTERFACE
+       },
+},
+{
+       USB_DEVICE(0x0582, 0x007d), /* UA-101 high speed */
+       .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+               .ifnum = QUIRK_NODEV_INTERFACE
+       },
+},
+{
+       USB_DEVICE(0x0582, 0x008d), /* UA-101 full speed */
+       .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+               .ifnum = QUIRK_NODEV_INTERFACE
+       },
+},
+
 /* this catches most recent vendor-specific Roland devices */
 {
        .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
index 8794c8658ab96fc185aed3cf8477f2f0119eea3f..a536ee33d36e2a8ca18036c85e4f43b7b4aa9ccd 100644 (file)
@@ -77,6 +77,7 @@ struct snd_usb_audio {
  */
 
 /* special values for .ifnum */
+#define QUIRK_NODEV_INTERFACE          -3      /* return -ENODEV */
 #define QUIRK_NO_INTERFACE             -2
 #define QUIRK_ANY_INTERFACE            -1