From: Daniel Mack <daniel@caiaq.de>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, clemens@ladisch.de
Subject: [PATCH 4/4] ALSA: usbmixer: bail out early when parsing audio class v2 descriptors
Date: Mon, 22 Feb 2010 17:28:57 +0100 [thread overview]
Message-ID: <1266856137-26252-5-git-send-email-daniel@caiaq.de> (raw)
In-Reply-To: <1266856137-26252-1-git-send-email-daniel@caiaq.de>
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>
---
sound/usb/usbmixer.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 2bfc446..79ce3f4 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -2209,7 +2209,8 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
.dev_free = snd_usb_mixer_dev_free
};
struct usb_mixer_interface *mixer;
- int err;
+ struct usb_host_interface *host_iface;
+ int err, protocol;
strcpy(chip->card->mixername, "USB Mixer");
@@ -2225,6 +2226,16 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
return -ENOMEM;
}
+ host_iface = &usb_ifnum_to_if(chip->dev, ctrlif)->altsetting[0];
+ protocol = host_iface->desc.bInterfaceProtocol;
+
+ /* FIXME! */
+ if (protocol != USB_AC_VERSION_1) {
+ snd_printk(KERN_WARNING "mixer interface protocol 0x%02x not yet supported\n",
+ protocol);
+ return 0;
+ }
+
if ((err = snd_usb_mixer_controls(mixer)) < 0 ||
(err = snd_usb_mixer_status_create(mixer)) < 0)
goto _error;
--
1.6.6.2
next prev parent reply other threads:[~2010-02-22 16:29 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 16:28 usbaudio: Support for USB audio v2.0 devices Daniel Mack
2010-02-22 16:28 ` [PATCH 1/4] ALSA: usbaudio: parse USB descriptors with structs Daniel Mack
2010-02-22 16:28 ` [PATCH 2/4] ALSA: usbaudio: introduce new types for audio class v2 Daniel Mack
2010-02-22 16:28 ` [PATCH 3/4] ALSA: usbaudio: implement basic set of class v2.0 parser Daniel Mack
2010-02-22 16:28 ` Daniel Mack [this message]
2010-02-22 17:40 ` usbaudio: Support for USB audio v2.0 devices Clemens Ladisch
2010-02-22 17:50 ` Daniel Mack
2010-03-02 9:13 ` adelias
2010-03-02 18:35 ` Daniel Mack
2010-04-27 13:23 ` adelias
2010-04-27 13:31 ` The Source
2010-04-27 14:07 ` Daniel Mack
2010-04-27 15:29 ` The Source
2010-04-27 15:43 ` Daniel Mack
2010-04-27 17:27 ` The Source
2010-04-27 17:33 ` Daniel Mack
2010-05-02 16:56 ` The Source
2010-05-03 20:55 ` Daniel Mack
2010-05-07 13:19 ` The Source
2010-05-07 13:22 ` Daniel Mack
2010-05-07 20:12 ` Daniel Mack
2010-05-07 21:32 ` The Source
2010-05-08 1:38 ` Daniel Mack
2010-05-08 7:26 ` The Source
2010-05-08 9:19 ` Daniel Mack
2010-05-08 9:24 ` [PATCH] ALSA: sound/usb: fix UAC1 regression Daniel Mack
2010-05-08 9:45 ` Takashi Iwai
2010-04-27 14:06 ` usbaudio: Support for USB audio v2.0 devices Daniel Mack
2010-05-03 12:49 ` adelias
2010-05-04 10:48 ` Daniel Mack
2010-05-18 7:07 ` adelias
2010-05-18 7:40 ` Daniel Mack
2010-05-18 8:32 ` adelias
2010-05-27 18:21 ` Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266856137-26252-5-git-send-email-daniel@caiaq.de \
--to=daniel@caiaq.de \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).