summaryrefslogtreecommitdiff
path: root/sound/usb/card.c
diff options
context:
space:
mode:
authorChris Wulff <crwulff@gmail.com>2020-03-14 19:54:49 +0300
committerTakashi Iwai <tiwai@suse.de>2020-03-14 20:25:03 +0300
commit55f7326170d9e83e2d828591938e1101982a679c (patch)
tree69e4664c8d57d9f34d0fed279c61249ab48cfe41 /sound/usb/card.c
parent0aef31b75272a9894f7205c2c888c7dbc248ce94 (diff)
downloadlinux-55f7326170d9e83e2d828591938e1101982a679c.tar.xz
ALSA: usb-audio: Create a registration quirk for Kingston HyperX Amp (0951:16d8)
Create a quirk that allows special processing and/or skipping the call to snd_card_register. For HyperX AMP, which uses two interfaces, but only has a capture stream in the second, this allows the capture stream to merge with the first PCM. Signed-off-by: Chris Wulff <crwulff@gmail.com> Link: https://lore.kernel.org/r/20200314165449.4086-3-crwulff@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r--sound/usb/card.c12
1 files changed, 8 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 */