public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] USB Audio Gadget: Support multiple sampling rates
@ 2017-06-26  7:35 Julian Scheel
  2017-06-26  7:35 ` [PATCH 1/3] usb: gadget: f_uac1: Fix endpoint reading Julian Scheel
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Julian Scheel @ 2017-06-26  7:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jonathan Corbet, Felipe Balbi, Julian Scheel,
	Ruslan Bilovol, Peter Chen, Sekhar Nori, Thierry Reding,
	linux-kernel, linux-usb, linux-doc

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCHv2 0/3] USB Audio Gadget: Support multiple sampling rates
@ 2017-06-30 10:00 Julian Scheel
  2017-06-30 10:00 ` [PATCHv2 3/3] usb: gadget: f_uac*: " Julian Scheel
  0 siblings, 1 reply; 11+ messages in thread
From: Julian Scheel @ 2017-06-30 10:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jonathan Corbet, Felipe Balbi, Julian Scheel,
	Ruslan Bilovol, Peter Chen, Sekhar Nori, Thierry Reding,
	linux-kernel, linux-usb, linux-doc

Sending v2 of this patch series, including fixes for build regressions
introduced with the original series. I missed the usage of f_uac* in the
legacy modules and did not test that. Fixed now, see patches changelog for
details.

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              | 118 +++++++-
 drivers/usb/gadget/function/u_audio.h              |   9 +-
 drivers/usb/gadget/function/u_uac.h                | 180 +++++++++++++
 drivers/usb/gadget/function/u_uac1.h               |  41 ---
 drivers/usb/gadget/function/u_uac2.h               |  44 ---
 drivers/usb/gadget/legacy/audio.c                  |  91 ++-----
 10 files changed, 608 insertions(+), 442 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.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-05 23:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26  7:35 [PATCH 0/3] USB Audio Gadget: Support multiple sampling rates Julian Scheel
2017-06-26  7:35 ` [PATCH 1/3] usb: gadget: f_uac1: Fix endpoint reading Julian Scheel
2017-06-26  7:35 ` [PATCH 2/3] usb: gadget: f_uac*: Reduce code duplication Julian Scheel
2017-06-26 23:39   ` kbuild test robot
2017-06-26  7:35 ` [PATCH 3/3] usb: gadget: f_uac*: Support multiple sampling rates Julian Scheel
2018-06-30 18:16   ` [PATCHv2 " Eugeniu Rosca
2018-07-02 14:07     ` Julian Scheel
2018-07-02 16:30       ` Eugeniu Rosca
2018-07-02 22:29         ` Ruslan Bilovol
2018-07-05 23:06           ` Eugeniu Rosca
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30 10:00 [PATCHv2 0/3] USB Audio Gadget: " Julian Scheel
2017-06-30 10:00 ` [PATCHv2 3/3] usb: gadget: f_uac*: " Julian Scheel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox