summaryrefslogtreecommitdiffstats
path: root/sound/usb/clock.c
diff options
context:
space:
mode:
authorRuslan Bilovol <ruslan.bilovol@gmail.com>2018-05-03 21:24:04 -0400
committerTakashi Iwai <tiwai@suse.de>2018-05-13 02:54:35 -0400
commit17156f23e93c0f59e06dd2aaffd06221341caaee (patch)
treef7eac9dcff74c160bc43f1a032b5d15647fbe1d8 /sound/usb/clock.c
parent10aa7cad37d330dbff6a285af56dc4a7153a8f00 (diff)
ALSA: usb: add UAC3 BADD profiles support
Recently released USB Audio Class 3.0 specification contains BADD (Basic Audio Device Definition) document which describes pre-defined UAC3 configurations. BADD support is mandatory for UAC3 devices, it should be implemented as a separate USB device configuration. As per BADD document, class-specific descriptors shall not be included in the Device’s Configuration descriptor ("inferred"), but host can guess them from BADD profile number, number of endpoints and their max packed sizes. This patch adds support of all BADD profiles from the spec Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Tested-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/clock.c')
-rw-r--r--sound/usb/clock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 0b030d8fe3fa..17673f37fcc8 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -587,8 +587,15 @@ int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface,
587 default: 587 default:
588 return set_sample_rate_v1(chip, iface, alts, fmt, rate); 588 return set_sample_rate_v1(chip, iface, alts, fmt, rate);
589 589
590 case UAC_VERSION_2:
591 case UAC_VERSION_3: 590 case UAC_VERSION_3:
591 if (chip->badd_profile >= UAC3_FUNCTION_SUBCLASS_GENERIC_IO) {
592 if (rate != UAC3_BADD_SAMPLING_RATE)
593 return -ENXIO;
594 else
595 return 0;
596 }
597 /* fall through */
598 case UAC_VERSION_2:
592 return set_sample_rate_v2v3(chip, iface, alts, fmt, rate); 599 return set_sample_rate_v2v3(chip, iface, alts, fmt, rate);
593 } 600 }
594} 601}