Received: by 10.192.165.148 with SMTP id m20csp213864imm; Thu, 3 May 2018 18:27:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZru39qJzVP/MWU8/IP/o8JwBsvyIcBTKJqFDLKUv0cw+WuXumpkx0BCwotQk/kAR4eC2OD7 X-Received: by 2002:a63:87c6:: with SMTP id i189-v6mr20316157pge.2.1525397247261; Thu, 03 May 2018 18:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525397247; cv=none; d=google.com; s=arc-20160816; b=tAWNfdkOBRPHWczJgpHxTQJ9ywFYeIGiDDb4tDGpIwJcbHEbMj3etmC4CgalnnC4OI aRGyH9l783q2g8tTDpk0X6PLwQV5wXKhuLG6f4PcZ5G5DOMUSZ1Bnf+TJUZMLTGNjwPM 1pnr473PhC8JZGVwAVV7Qcm3AbNz+b/+GLHfSizmOOSAYfnmKjaoS/LXzWx4N8uRqHMk JzWr7SPDAetwyGTxQY82jls0YzMtQB2od7jFw8saaB0rvEV/P8sbMna7AH6p1H6OgwUa WjNoZHXK/a+jiP/bQ+FqMuMSnDwDF3LbXH+7wRWLpw+GCPmeAeeU6NA47J526lhaQjD4 CasA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=JYiEkko72DtkesBuFZdNkly8w/aDOD6VivnmAubVmuc=; b=nDIPT92oHrqvKitcNan9m2xvkAnLxHbg4J7QturDcmmeY3WSsKp7o08sYQn/afnscD 5GyMcVMcNgb6dNaM+nIyAgv48wzi4HSIoAQmGMyqGtcoLiM5GpqpOiDQneys1oOk6XVn rfdpRGAyz2BZmYBYGqM2ayOlKALYqqtwMYA3n/xhv/TMvwUXgiJdATE7MYQis7OX0TPE OEMfqTuRAr/5CEe4HMtkvk14SoW37bj0F2C+sKo5Uz21kfXGCpS2SaNTxLiRUUY8Y9On sNbq3O96OW93JY/u8w97x7ThSdeiIOpe/idBJOmeBSstl6tmAtZPI1JmGlQv49Kq8wkF hq9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FhcZy1hH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g72si12615329pfb.280.2018.05.03.18.27.13; Thu, 03 May 2018 18:27:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FhcZy1hH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbeEDBYv (ORCPT + 99 others); Thu, 3 May 2018 21:24:51 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35244 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbeEDBYu (ORCPT ); Thu, 3 May 2018 21:24:50 -0400 Received: by mail-lf0-f66.google.com with SMTP id y72-v6so14901363lfd.2 for ; Thu, 03 May 2018 18:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JYiEkko72DtkesBuFZdNkly8w/aDOD6VivnmAubVmuc=; b=FhcZy1hHyTpVdbrnpjd34PpoAK/hDSQTgJKFHUBuHqfg9YeXJuPnjoOxJVZheyYvvZ YGlhMalrdP2Dr7UU9NonACmS2JXqNU0VtA8cgS1qtDTz1qozPFeCPR4tRQz8iznX7yZ3 fJWA6rIp6cDzx50Djcw5svMZ7jW6CFNWWx8Y7gEA0zWGD/4ZbzdFh9FXRFItHm+noVHp z/CBMM7TEjnwiBCg/U23akitSLPz9rbDJ+l+Av5rjOa7t1fNaQhz632IUmqXadCdLOOm +ovfcy8/OJxO3L+Sj9z+cQUz3YsS6vKxoo5YmKZqHAU1RST21VM32AwmO3lwVsiVT9bS nkEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JYiEkko72DtkesBuFZdNkly8w/aDOD6VivnmAubVmuc=; b=m+CkQoleFRpdErDwuvJqb9efC/Y6gpjBZRDcwO38lYLDuKw4wbMVbAqTSD2C0PuT76 kSSIXXC84+qBlQOgSeIaZK1mkL6XmDNGDtcEVGjzPL5/dkkEkssRl1v73qp+15LGJ5Gx 3UQHHx7iM8fAGMTBxY5oPY/WB+NLu0aSp19QQDSA0bvWXnorW6TaMNBp5xQOJWJDJWgr VDRE6q/+yPWpyh/lrkXPGSx6CYAyXqOP8FP+bXmYoBeUsanZw+CJnpfMJWFJieqVteHe qKODt6n8m3Qoo9YmG1ZgG2Iza9remzOVvgfnO3Zknx1TNhrtPVwRnOKamC1ZSmByXhwO SFIQ== X-Gm-Message-State: ALQs6tByG8hIgriGorHB61sE0lNegtA9K2XYXCMvER5Wj0VOIC11WThp rK84kYnab/wF5sS5n5thBT4= X-Received: by 2002:a19:1303:: with SMTP id j3-v6mr53205lfi.107.1525397088964; Thu, 03 May 2018 18:24:48 -0700 (PDT) Received: from localhost ([62.216.57.27]) by smtp.gmail.com with ESMTPSA id d7-v6sm1685183ljc.45.2018.05.03.18.24.47 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 03 May 2018 18:24:48 -0700 (PDT) From: Ruslan Bilovol To: Takashi Iwai Cc: Jorge , Andrew Chant , Greg Kroah-Hartman , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/7] USB Audio Device Class 3.0 BADD profiles support Date: Fri, 4 May 2018 04:23:57 +0300 Message-Id: <1525397044-15080-1-git-send-email-ruslan.bilovol@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds BADD profiles support from the USB Audio Device Class 3.0 spec [1]. BADD profile support is defined as mandatory feature of UAC3-compliant device, it should be implemented as a separate USB configuration. Notable issue with BADD configuration is that it misses class-specific descriptors (and it's mandatory as per spec), so host should guess them from BADD profile number and parameters of endpoints (type, number of endpoints and max packet size) This patchset adds support of all known/existing BADD profiles from the UAC3 specification. First 5 patches are refactoring and improvements, and last 2 patches actually implement UAC3 BADD profiles support. It's an alternative implementation comparing to [2], and doesn't build usb descriptors on the host but instead initializes alsa-usb structures with known parameters, so we don't need to keep whole class-specific descriptors in the driver since we anyway need to have BADD-specific logic. I've picked one Jorge's UAC1 patch-improvement and updated it to v4.17 wich contais recently introduced header's sanity checks. Remaining part is to add interrupt endpoint support so we will be able to detect jack insertion in the Headset Adapter profile. This has been tested on ARM and x86-64 machines with custom UAC3 gadget which I'll post later to linux-usb Comments and testing are welcome. v2: - split refactoring patch to more atomic and bisectable changes as suggested by Takashi - renamed "Side Tone"->"Sidetone" as suggested by Andrew - revorked main BADD patch to have table lookup for checking BADD channels validity and to reduce identation as suggested by Takashi - also removed code duplication in BADD patch by reusing common part of build_feature_ctl() func v1: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-April/134412.html [1] http://www.usb.org/developers/docs/devclass_docs/USB_Audio_v3.0.zip [2] https://www.spinics.net/lists/alsa-devel/msg71614.html Jorge Sanjuan (1): ALSA: usb: Only get AudioControl header for UAC1 class. Ruslan Bilovol (6): ALSA: usb: stream: move audioformat alloc/init into separate function ALSA: usb: stream: refactor uac1/2 audio interface parsing ALSA: usb: stream: refactor uac3 audio interface parsing ALSA: usb: mixer: make string parsing independent of mixer_build state include: usb: audio-v3: add BADD-specific values ALSA: usb: add UAC3 BADD profiles support include/linux/usb/audio-v3.h | 26 ++ sound/usb/card.c | 53 ++-- sound/usb/clock.c | 9 +- sound/usb/mixer.c | 351 +++++++++++++++++++--- sound/usb/mixer_maps.c | 65 ++++ sound/usb/stream.c | 687 +++++++++++++++++++++++++------------------ sound/usb/usbaudio.h | 2 + 7 files changed, 849 insertions(+), 344 deletions(-) -- 1.9.1