summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/usb/card.c12
-rw-r--r--sound/usb/quirks.c14
-rw-r--r--sound/usb/quirks.h3
3 files changed, 25 insertions, 4 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 827fb0bc8b56..16bbe2a50fb7 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -662,10 +662,14 @@ static int usb_audio_probe(struct usb_interface *intf,
goto __error;
}
- /* we are allowed to call snd_card_register() many times */
- err = snd_card_register(chip->card);
- if (err < 0)
- goto __error;
+ /* we are allowed to call snd_card_register() many times, but first
+ * check to see if a device needs to skip it or do anything special
+ */
+ if (snd_usb_registration_quirk(chip, ifnum) == 0) {
+ err = snd_card_register(chip->card);
+ if (err < 0)
+ goto __error;
+ }
if (quirk && quirk->shares_media_device) {
/* don't want to fail when snd_media_device_create() fails */
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 3cc745fe24d8..d605aff801b8 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1808,3 +1808,17 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
break;
}
}
+
+int snd_usb_registration_quirk(struct snd_usb_audio *chip,
+ int iface)
+{
+ switch (chip->usb_id) {
+ case USB_ID(0x0951, 0x16d8): /* Kingston HyperX AMP */
+ /* Register only when we reach interface 2 so that streams can
+ * merge correctly into PCMs from interface 0
+ */
+ return (iface != 2);
+ }
+ /* Register as normal */
+ return 0;
+}
diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h
index df0355843a4c..3afc01eabc7e 100644
--- a/sound/usb/quirks.h
+++ b/sound/usb/quirks.h
@@ -51,4 +51,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
struct audioformat *fp,
int stream);
+int snd_usb_registration_quirk(struct snd_usb_audio *chip,
+ int iface);
+
#endif /* __USBAUDIO_QUIRKS_H */