Received: by 10.192.165.148 with SMTP id m20csp4916205imm; Tue, 24 Apr 2018 10:28:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CQgctfd9zSjMPLUtapJmGvzb9jlHW5H+oTHFLMWUCCVoNtLPI1pNkFigR3L2miyzFm3Od X-Received: by 10.98.129.5 with SMTP id t5mr12558291pfd.215.1524590916062; Tue, 24 Apr 2018 10:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524590916; cv=none; d=google.com; s=arc-20160816; b=1JOpMPZfNfU3R4x2b3xDY4Ygf0EnnpR+XyfVgqaHWNtokh3DmcxtkKCiFmueqmAaGy uQeNvPdxUh0MdHUSstEbKyWHwbrrLZfTf/qXTNtAYgIk1Hlng87zv4FR6shsV/tnIm6i vlymWDPrgTlVpWgX29Pi6eAOFur+5Huftvdcn8gi1U5aX6lLyl8Xj3EHKxgltmkkWV32 /640AnJHSd3mFrjqJCL/5GBHCbSCN9Iq2CutTPBGTaoPE8F0tPLuKzF7G4mfeqPIaXKH EQod3pPvCEAdV0mpRY90BMVeRZ+0dz4uxlqzGaAFsuLzAW9sjaITMq6Sk5GOiVjj1G17 WcVQ== 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=ShQzqDcsHIGhHN/x3t70qMX14Fx+I1CLl8H7JFxXGYE=; b=ElXbliwJXeOKdDufrUfklxxBDJNoCO70oZNidFZhsycYFzyHEgzV8nBgbrAvmCnOS0 epjJ7CYWmzxssmNwkQkhvXmkjcOmaZeQnxr9CTmVoNPCjh0b+5/9RM4gs8/aKmV46o+0 fprkm+T3c5aFiAjmFn+/uScJwAWL5jx2mP6suvOYTG1u9favPmkt35dTbC523DkWkV2M 1w5sMHgxATfs/+jmpi2WMZbYYl/IvtU6Ya47D6AvrrV1ulT7B3w0o+XSRdskEPH9cAd0 Za0AdO8jr8PBnZlqU02nM6ed89dHoGv428tMG4RXo+PaF6hPjcWUcfvs98nUyU7aY58T aZ/w== 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 j5si2575693pga.638.2018.04.24.10.28.21; Tue, 24 Apr 2018 10:28:36 -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 S1752695AbeDXR0Z (ORCPT + 99 others); Tue, 24 Apr 2018 13:26:25 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:46184 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbeDXRY7 (ORCPT ); Tue, 24 Apr 2018 13:24:59 -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 1fB1gW-0005ev-31; Tue, 24 Apr 2018 18:24:56 +0100 From: Jorge Sanjuan To: tiwai@suse.com Cc: alsa-devel@alsa-project.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Jorge Sanjuan Subject: [PATCH v2 3/4] ALSA: usb-audio: Use Class Specific EP for UAC3 devices. Date: Tue, 24 Apr 2018 18:24:44 +0100 Message-Id: <20180424172445.31928-4-jorge.sanjuan@codethink.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180424172445.31928-1-jorge.sanjuan@codethink.co.uk> References: <20180420170327.31569-1-jorge.sanjuan@codethink.co.uk> <20180424172445.31928-1-jorge.sanjuan@codethink.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jorge Sanjuan --- sound/usb/stream.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, if (protocol == UAC_VERSION_1) { attributes = csep->bmAttributes; - } else { + } else if (protocol == UAC_VERSION_2) { struct uac2_iso_endpoint_descriptor *csep2 = (struct uac2_iso_endpoint_descriptor *) csep; @@ -585,6 +585,13 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, /* emulate the endpoint attributes of a v1 device */ if (csep2->bmControls & UAC2_CONTROL_PITCH) attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL; + } else { /* UAC_VERSION_3 */ + struct uac3_iso_endpoint_descriptor *csep3 = + (struct uac3_iso_endpoint_descriptor *) csep; + + /* emulate the endpoint attributes of a v1 device */ + if (le32_to_cpu(csep3->bmControls) & UAC2_CONTROL_PITCH) + attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL; } return attributes; -- 2.11.0