Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4189255imm; Mon, 14 May 2018 04:05:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/rUmBH+hyROkIjnqwWe/rGkR/lH8ZzVCHJUsoP0JfBsV1XETJiRrh/QrV2VtFvbUkzLY+ X-Received: by 2002:a65:61c8:: with SMTP id j8-v6mr8094892pgv.370.1526295939233; Mon, 14 May 2018 04:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526295939; cv=none; d=google.com; s=arc-20160816; b=IfO0QOq2VU5wb0SZVPpdQ52FcreEJgcqYj/JDLMV9phRrcwuDiXsn8OjZG8CjGetEz D6x63h4wt0p1s4quOlAAATI1D/4r+jcYJ4E/TrS4hEnxBggTkj1fdsKRhwbVf4NvQr1Q znnuJIBIvdV43DWF/sYz9cdQJjyGUDqkJzvOqNTF/QJMCS2B/mpMOdH6LjZf6hyFSmVY f0SxiZq4lK0M6VqeZx9brfWgVeII+1D8La7nT41EBpQd0cCgN9fBtBsPrKcfOstxi/rj WZYHYwrLHWHcXFVjIVHFnb44oZiAdLt8cIdxWwigJoD5hPx8CsLk/gQrOyBVFNkqpvoE ibsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=860prkDm7uuH0MiY0+X0IGeakckLa/tTCfYTdJF180k=; b=IF/eaguEKfr/TWgWtSRerKXfc34s5uIHR2YVIVmyC2GT+mNBQ/YD8t3FK3K1xmrODJ ZBgcQXQm7068Y49bBokOldUP/lZbBZd+TI2YuGYhOPuSJrp+MwELNwe4UExGr6XjPIVV Zm8Vo/AnR/Ogr6d2Oe4pRtnPp5TFF/PQdIty6B/097PPXp2AOxnA96n+RuPDVZ0P2HrP LXEFMeBusQqZSEmq9A7YegrST9WU+5odn/UdIUgMrE9ILbK8kRQitCDCrLyvMXXDsL2Q JkDVbyponZSa23Eawzh97J41lk9LUtLngZKArPW2o7WuM+FDNU4590kDHpBzkR/My+Ff GzVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4-v6si9643127pff.24.2018.05.14.04.05.24; Mon, 14 May 2018 04:05:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbeENLEE (ORCPT + 99 others); Mon, 14 May 2018 07:04:04 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:52346 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbeENLD6 (ORCPT ); Mon, 14 May 2018 07:03:58 -0400 Received: from 167-98-27-229.cust-167.exponential-e.net ([167.98.27.229] helo=ct-lt-1121.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1fIBGk-0005lF-0O; Mon, 14 May 2018 12:03:54 +0100 From: Jorge Sanjuan To: tiwai@suse.com Cc: alsa-devel@alsa-project.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ruslan.bilovol@gmail.com, Jorge Sanjuan Subject: [RESEND PATCH v4 4/4] ALSA: usb-audio: UAC3: Parse Input Terminal number of channels. Date: Mon, 14 May 2018 12:03:42 +0100 Message-Id: <20180514110342.23683-1-jorge.sanjuan@codethink.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180511152537.32267-5-jorge.sanjuan@codethink.co.uk> References: <20180511152537.32267-5-jorge.sanjuan@codethink.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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