Received: by 10.192.165.148 with SMTP id m20csp501577imm; Fri, 20 Apr 2018 10:09:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx48b0vJkwExAkxEcsvzt6s0OglQj5qRQ4VM4LQRuDA1TgEfSOac+wM+pSZ2ctI+4+0ATw5Wn X-Received: by 10.98.232.15 with SMTP id c15mr2199096pfi.156.1524244157924; Fri, 20 Apr 2018 10:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524244157; cv=none; d=google.com; s=arc-20160816; b=VQryPKpXpo6B74V5DHS66CPfNyVIMz0sk1RXhFUx2maRxekX++Oos2v4MdwHEAFo1I fpXFxFl6MJO6kf9eFBPbjcbCJJvA3nRAMVm6WQO8cYpwS7D8/enWYSPn0y6nYoa+Z1Aq GtD+NfFm+nHXxs7AMQz7Y2GSVgb2BKYW9RdZ1pUw319Y7CMKRK7xPg3jSMjLDc8b275r BDEGV1Wsc8AhkPAgvqHJ8M3BDxOUq9SbKVrcoBCQPZ8QGhlXD/hyj8RDsDCXj8O2uqGL KmN9SS/Wsjovj3DZHgGBe4AkvVLOOSk0hS11UNfUuEDEHA4aozxYJi7gCgoF5ePJCoSo EZtg== 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=whiZIEUf1kRw5JeK1tZey3jJLLn4nIU9xRX59d7bezc=; b=HSfIcBQVbh58EouhyfCL5ecF4ZZ4YZFAmrlDnBJNMpNzQLBz5jhOZes1rKRYQLIHIR YdWfQld5761YDJdEOz2yMuKzdERaYptKihDgpiTvWIoK9qVk9N7Q4gff+bEQRi5Apmzh rCnHZKKrvwyZ2tiNMDaccPLRjVP3nAaIh9T5wpFrFJO0RL99l3f8uMNnb3vUixzn3oyH r1FbMbOe+6xwnbVzuxO+ggFoQjrf3Dft18aXJC2BOYXcg5kYYHUFGFAcdGMnKdmdqJtZ BNA4DOBdUvqnLbfjq5ZVT4SNY6ANAJVvWLgrucN0Zo73hkUPXkp30K9ydzsmcCR8sAgI qrlA== 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 p12-v6si6406017plr.131.2018.04.20.10.09.03; Fri, 20 Apr 2018 10:09:17 -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 S1753571AbeDTRFE (ORCPT + 99 others); Fri, 20 Apr 2018 13:05:04 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:47063 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753422AbeDTRDm (ORCPT ); Fri, 20 Apr 2018 13:03:42 -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 1f9ZRj-0007hw-Pp; Fri, 20 Apr 2018 18:03:39 +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 3/4] ALSA: usb-audio: Use Class Specific EP for UAC3 devices. Date: Fri, 20 Apr 2018 18:03:26 +0100 Message-Id: <20180420170327.31569-4-jorge.sanjuan@codethink.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180420170327.31569-1-jorge.sanjuan@codethink.co.uk> References: <20180420170327.31569-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 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 956be9f7c72a..344e0ecf6d59 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -574,9 +574,11 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, return 0; } - if (protocol == UAC_VERSION_1) { + switch (protocol) { + case UAC_VERSION_1: attributes = csep->bmAttributes; - } else { + break; + case UAC_VERSION_2: { struct uac2_iso_endpoint_descriptor *csep2 = (struct uac2_iso_endpoint_descriptor *) csep; @@ -585,6 +587,17 @@ 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; + break; + } + case UAC_VERSION_3: { + struct uac3_iso_endpoint_descriptor *csep3 = + (struct uac3_iso_endpoint_descriptor *) csep; + + /* emulate the endpoint attributes of a v1 device */ + if (csep3->bmControls & UAC2_CONTROL_PITCH) + attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL; + break; + } } return attributes; -- 2.11.0