[PATCH 0/1] USB Audio Device Class 3.0 Gadget support
From: Ruslan Bilovol
Date: Mon Nov 06 2017 - 20:52:12 EST
Hi,
This patch adds USB Audio Device Class 3.0 [1] function
support to gadget subsystem.
I didn't add UAC3 support to legacy gadget as it will
make preprocessor configuration too complex (UAC3 device
must have two configurations for backward compatibility,
first is UAC1/2 and second is UAC3), yet also I'm too lazy
to do that and verify all possible configurations.
For modern ConfigFS interface I'll provide my configuration
for testing below; testing was done on a BeagleBone Black
board.
This patch depends on uac3 header files from include dir
which I'll post as part of ALSA host UAC3 patch and will
provide the link to it here.
uac_3
------------
mkdir cfg
mount none cfg -t configfs
mkdir cfg/usb_gadget/g1
cd cfg/usb_gadget/g1
mkdir configs/c.1
mkdir functions/uac3.0
mkdir strings/0x409
mkdir configs/c.1/strings/0x409
echo 0x0101 > idProduct
echo 0x1d6b > idVendor
echo my-serial-num > strings/0x409/serialnumber
echo my-manufacturer > strings/0x409/manufacturer
echo "Test gadget" > strings/0x409/product
echo "Conf 1" > configs/c.1/strings/0x409/configuration
echo 120 > configs/c.1/MaxPower
ln -s functions/uac3.0 configs/c.1
echo musb-hdrc.0 > UDC
uac_3 + uac2
------------
mkdir cfg
mount none cfg -t configfs
mkdir cfg/usb_gadget/g1
cd cfg/usb_gadget/g1
mkdir configs/c.1
mkdir functions/uac2.0
mkdir strings/0x409
mkdir configs/c.1/strings/0x409
echo "Test gadget" > strings/0x409/product
echo "Conf 1" > configs/c.1/strings/0x409/configuration
echo 120 > configs/c.1/MaxPower
ln -s functions/uac2.0 configs/c.1
mkdir configs/c.2
mkdir functions/uac3.0
mkdir strings/0x409
mkdir configs/c.2/strings/0x409
echo "Conf 2" > configs/c.2/strings/0x409/configuration
echo 120 > configs/c.2/MaxPower
ln -s functions/uac3.0 configs/c.2
echo 0x0101 > idProduct
echo 0x1d6b > idVendor
echo my-serial-num > strings/0x409/serialnumber
echo my-manufacturer > strings/0x409/manufacturer
echo musb-hdrc.0 > UDC
[1] http://www.usb.org/developers/docs/devclass_docs/USB_Audio_v3.0.zip
Ruslan Bilovol (1):
usb: gadget: add USB Audio Device Class 3.0 gadget support
Documentation/ABI/testing/configfs-usb-gadget-uac3 | 14 +
Documentation/usb/gadget-testing.txt | 41 +
drivers/usb/gadget/Kconfig | 22 +
drivers/usb/gadget/function/Makefile | 2 +
drivers/usb/gadget/function/f_uac3.c | 1497 ++++++++++++++++++++
drivers/usb/gadget/function/u_uac3.h | 38 +
drivers/usb/gadget/legacy/Kconfig | 3 +-
7 files changed, 1616 insertions(+), 1 deletion(-)
create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-uac3
create mode 100644 drivers/usb/gadget/function/f_uac3.c
create mode 100644 drivers/usb/gadget/function/u_uac3.h
--
1.9.1