Commit 5e688883 authored by Daniel Mack's avatar Daniel Mack Committed by Takashi Iwai

ALSA: sound/usb: fix UAC1 regression

Commit 23caaf19 ("ALSA: usb-mixer: Add support for Audio Class v2.0")
broke support for Class1 devices due to two faulty changes. This patch
fixes it.
Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Reported-and-Tested-by: default avatarThe Source <thesourcehim@gmail.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 27762b2c
...@@ -244,7 +244,7 @@ struct uac_selector_unit_descriptor { ...@@ -244,7 +244,7 @@ struct uac_selector_unit_descriptor {
static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
{ {
__u8 *raw = (__u8 *) desc; __u8 *raw = (__u8 *) desc;
return raw[desc->bLength - 1]; return raw[9 + desc->bLength - 1];
} }
/* 4.3.2.5 Feature Unit Descriptor */ /* 4.3.2.5 Feature Unit Descriptor */
......
...@@ -656,7 +656,7 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ ...@@ -656,7 +656,7 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
case UAC_FEATURE_UNIT: { case UAC_FEATURE_UNIT: {
/* the header is the same for v1 and v2 */ /* the header is the same for v1 and v2 */
struct uac_feature_unit_descriptor *d = p1; struct uac_feature_unit_descriptor *d = p1;
id = d->bUnitID; id = d->bSourceID;
break; /* continue to parse */ break; /* continue to parse */
} }
case UAC_MIXER_UNIT: { case UAC_MIXER_UNIT: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment