aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-02-22 17:49:12 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-23 02:40:26 -0500
commit7b8a043f2686af9f41e313a78ed5e98233e5fded (patch)
treeaf7b3a3d2a6394b2a6053681b7f251315570b293
parent53ee98fe8ac77d00bacc1c814d450d83cbd193d4 (diff)
ALSA: usbmixer: bail out early when parsing audio class v2 descriptors
This is just a quick hack that needs to be removed once the new units defined by the audio class v2.0 standard are supported. However, it allows using these devices for now, without mixer support. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/usbmixer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index ca7949598191..42bb95c739a8 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -2258,7 +2258,8 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
2258 }; 2258 };
2259 struct usb_mixer_interface *mixer; 2259 struct usb_mixer_interface *mixer;
2260 struct snd_info_entry *entry; 2260 struct snd_info_entry *entry;
2261 int err; 2261 struct usb_host_interface *host_iface;
2262 int err, protocol;
2262 2263
2263 strcpy(chip->card->mixername, "USB Mixer"); 2264 strcpy(chip->card->mixername, "USB Mixer");
2264 2265
@@ -2275,6 +2276,16 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
2275 return -ENOMEM; 2276 return -ENOMEM;
2276 } 2277 }
2277 2278
2279 host_iface = &usb_ifnum_to_if(chip->dev, ctrlif)->altsetting[0];
2280 protocol = host_iface->desc.bInterfaceProtocol;
2281
2282 /* FIXME! */
2283 if (protocol != UAC_VERSION_1) {
2284 snd_printk(KERN_WARNING "mixer interface protocol 0x%02x not yet supported\n",
2285 protocol);
2286 return 0;
2287 }
2288
2278 if ((err = snd_usb_mixer_controls(mixer)) < 0 || 2289 if ((err = snd_usb_mixer_controls(mixer)) < 0 ||
2279 (err = snd_usb_mixer_status_create(mixer)) < 0) 2290 (err = snd_usb_mixer_status_create(mixer)) < 0)
2280 goto _error; 2291 goto _error;