aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Sanjuan <jorge.sanjuan@codethink.co.uk>2018-05-11 11:25:35 -0400
committerTakashi Iwai <tiwai@suse.de>2018-05-15 01:29:10 -0400
commitc99f0802e42fcd38e84ee4d306691805ebed204f (patch)
tree7ab505bdf74f8977c919b52934d4358f7c5faccc
parent2f0d520a1a73555ac51c19cd494493f60b4c1cea (diff)
ALSA: usb-audio: Use Class Specific EP for UAC3 devices.
bmAtributes offset doesn't exist in the UAC3 CS_EP descriptor. Hence, checking for pitch control as if it was UAC2 doesn't make any sense. Use the defined UAC3 offsets instead. Fixes: 9a2fe9b801f5 ("ALSA: usb: initial USB Audio Device Class 3.0 support") Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/stream.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index 956be9f7c72a..5ed334575fc7 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -576,7 +576,7 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
576 576
577 if (protocol == UAC_VERSION_1) { 577 if (protocol == UAC_VERSION_1) {
578 attributes = csep->bmAttributes; 578 attributes = csep->bmAttributes;
579 } else { 579 } else if (protocol == UAC_VERSION_2) {
580 struct uac2_iso_endpoint_descriptor *csep2 = 580 struct uac2_iso_endpoint_descriptor *csep2 =
581 (struct uac2_iso_endpoint_descriptor *) csep; 581 (struct uac2_iso_endpoint_descriptor *) csep;
582 582
@@ -585,6 +585,13 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
585 /* emulate the endpoint attributes of a v1 device */ 585 /* emulate the endpoint attributes of a v1 device */
586 if (csep2->bmControls & UAC2_CONTROL_PITCH) 586 if (csep2->bmControls & UAC2_CONTROL_PITCH)
587 attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL; 587 attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
588 } else { /* UAC_VERSION_3 */
589 struct uac3_iso_endpoint_descriptor *csep3 =
590 (struct uac3_iso_endpoint_descriptor *) csep;
591
592 /* emulate the endpoint attributes of a v1 device */
593 if (le32_to_cpu(csep3->bmControls) & UAC2_CONTROL_PITCH)
594 attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
588 } 595 }
589 596
590 return attributes; 597 return attributes;