diff mbox

[RESEND,v4,4/4] ALSA: usb-audio: UAC3: Parse Input Terminal number of channels.

Message ID 20180514110342.23683-1-jorge.sanjuan@codethink.co.uk
State New, archived
Headers show

Commit Message

Jorge Sanjuan May 14, 2018, 11:03 a.m. UTC
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>
---
 sound/usb/mixer.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Ruslan Bilovol May 14, 2018, 9:05 p.m. UTC | #1
On Mon, May 14, 2018 at 2:03 PM, Jorge Sanjuan
<jorge.sanjuan@codethink.co.uk> wrote:
> 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.

Usually 'patch resend' means resend without any changes, and if there
are updates in the patch - it's a new version.

By the way, as I already said in comments to patch 1/4 [1], I verified
this patch successfully.

Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2018-May/136044.html

>
> Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
> ---
>  sound/usb/mixer.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 431f3c319839..99804cd4aed6 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -904,8 +904,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);
> --
> 2.11.0
>
diff mbox

Patch

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 431f3c319839..99804cd4aed6 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -904,8 +904,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);