Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbdFZHfU (ORCPT ); Mon, 26 Jun 2017 03:35:20 -0400 Received: from jusst.de ([188.40.114.84]:36321 "EHLO web01.jusst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751391AbdFZHfO (ORCPT ); Mon, 26 Jun 2017 03:35:14 -0400 Authentication-Results: web01.jusst.de (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=jusst.de From: Julian Scheel To: Greg Kroah-Hartman , Jonathan Corbet , Felipe Balbi , Julian Scheel , Ruslan Bilovol , Peter Chen , Sekhar Nori , Thierry Reding , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 0/3] USB Audio Gadget: Support multiple sampling rates Date: Mon, 26 Jun 2017 09:35:02 +0200 Message-Id: <20170626073505.2792-1-julian@jusst.de> X-Mailer: git-send-email 2.13.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1936 Lines: 36 This patch series adds support for exposing multiple supported sampling rates from UAC1 and UAC2 USB gadgets to the connected host. It is currently limited to up to ten discrete sampling frequencies. The USB specification does not actually limit this, but to avoid complex list handling I am using a static array for now. As the configfs bindings for f_uac1 and f_uac2 have been identical already, I decided to move the shared code for this out of the functions first. This avoids code duplication and simplifies the addition of the list parsing for sampling rates. The host can configure active sampling rate and the function adapts it's internal active rate automatically. On playback/capture start the rate is checked, so that the user recognizes rate mismatches. Furthermore the active rate is exposed as an amixer control with change notifications, so that users can check current rate upfront and get notified about updates. Julian Scheel (3): usb: gadget: f_uac1: Fix endpoint reading usb: gadget: f_uac*: Reduce code duplication usb: gadget: f_uac*: Support multiple sampling rates Documentation/ABI/testing/configfs-usb-gadget-uac1 | 4 +- Documentation/usb/gadget-testing.txt | 8 +- drivers/usb/gadget/function/f_uac1.c | 258 +++++++++--------- drivers/usb/gadget/function/f_uac2.c | 297 ++++++++++----------- drivers/usb/gadget/function/u_audio.c | 116 +++++++- drivers/usb/gadget/function/u_audio.h | 9 +- drivers/usb/gadget/function/u_uac.h | 178 ++++++++++++ drivers/usb/gadget/function/u_uac1.h | 41 --- drivers/usb/gadget/function/u_uac2.h | 44 --- 9 files changed, 582 insertions(+), 373 deletions(-) create mode 100644 drivers/usb/gadget/function/u_uac.h delete mode 100644 drivers/usb/gadget/function/u_uac1.h delete mode 100644 drivers/usb/gadget/function/u_uac2.h -- 2.13.1