summaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
authorJorge Sanjuan <jorge.sanjuan@codethink.co.uk>2018-05-14 12:03:42 +0100
committerTakashi Iwai <tiwai@suse.de>2018-05-15 07:36:06 +0200
commit710669455d9e6978336dcbcb220024fb64ec2d38 (patch)
tree7e41dd812bf7e3f8be0f6e345cf8a2f592d73428 /sound/usb/mixer.c
parent1d38f5d828b45546e53095a172c77556642a8a04 (diff)
downloadop-kernel-dev-710669455d9e6978336dcbcb220024fb64ec2d38.zip
op-kernel-dev-710669455d9e6978336dcbcb220024fb64ec2d38.tar.gz
ALSA: usb-audio: UAC3: Parse Input Terminal number of channels.
Obtain the number of channels for the Input Terminal from the Logical Cluster Descriptor. This achieves a useful minimal parsing of this unit so it can be used in other units in the topology. Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index fb77847..bf74e7e 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -902,8 +902,12 @@ static int check_input_term(struct mixer_build *state, int id,
term->id = id;
term->type = le16_to_cpu(d->wTerminalType);
- /* REVISIT: UAC3 IT doesn't have channels/cfg */
- term->channels = 0;
+ err = get_cluster_channels_v3(state, le16_to_cpu(d->wClusterDescrID));
+ if (err < 0)
+ return err;
+ term->channels = err;
+
+ /* REVISIT: UAC3 IT doesn't have channels cfg */
term->chconfig = 0;
term->name = le16_to_cpu(d->wTerminalDescrStr);
OpenPOWER on IntegriCloud