diff options
author | Torstein Hegge <hegge@resisty.net> | 2013-03-19 12:12:14 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-20 03:42:12 -0400 |
commit | 61ac51301e6c6d4ed977d7674ce2b8e713619a9b (patch) | |
tree | 8279d9468a4cb442bde1a8f2b19a67448cddca52 /sound/usb/mixer.c | |
parent | 039eb75350acd1131a18a9bd12a0d4e1fb17892e (diff) |
ALSA: usb: Parse UAC2 extension unit like for UAC1
UAC2_EXTENSION_UNIT_V2 differs from UAC1_EXTENSION_UNIT, but can be handled in
the same way when parsing the unit. Otherwise parse_audio_unit() fails when it
sees an extension unit on a UAC2 device.
UAC2_EXTENSION_UNIT_V2 is outside the range allocated by UAC1.
Signed-off-by: Torstein Hegge <hegge@resisty.net>
Acked-by: Daniel Mack <zonque@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r-- | sound/usb/mixer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 638e7f738018..8eb84c0f7bf1 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -725,7 +725,8 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ | |||
725 | case UAC1_PROCESSING_UNIT: | 725 | case UAC1_PROCESSING_UNIT: |
726 | case UAC1_EXTENSION_UNIT: | 726 | case UAC1_EXTENSION_UNIT: |
727 | /* UAC2_PROCESSING_UNIT_V2 */ | 727 | /* UAC2_PROCESSING_UNIT_V2 */ |
728 | /* UAC2_EFFECT_UNIT */ { | 728 | /* UAC2_EFFECT_UNIT */ |
729 | case UAC2_EXTENSION_UNIT_V2: { | ||
729 | struct uac_processing_unit_descriptor *d = p1; | 730 | struct uac_processing_unit_descriptor *d = p1; |
730 | 731 | ||
731 | if (state->mixer->protocol == UAC_VERSION_2 && | 732 | if (state->mixer->protocol == UAC_VERSION_2 && |
@@ -2052,6 +2053,8 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) | |||
2052 | return parse_audio_extension_unit(state, unitid, p1); | 2053 | return parse_audio_extension_unit(state, unitid, p1); |
2053 | else /* UAC_VERSION_2 */ | 2054 | else /* UAC_VERSION_2 */ |
2054 | return parse_audio_processing_unit(state, unitid, p1); | 2055 | return parse_audio_processing_unit(state, unitid, p1); |
2056 | case UAC2_EXTENSION_UNIT_V2: | ||
2057 | return parse_audio_extension_unit(state, unitid, p1); | ||
2055 | default: | 2058 | default: |
2056 | snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); | 2059 | snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); |
2057 | return -EINVAL; | 2060 | return -EINVAL; |