usb: gadget: f_uac2: allow changing terminal types through configfs
authorJames Gruber <jimmyjgruber@gmail.com>
Thu, 14 Sep 2023 22:27:46 +0000 (15:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2023 07:35:43 +0000 (09:35 +0200)
commitde2eb28cdb76df9ce7587e1c6552b169069af4bb
tree1265bc4e1592071efb2410fd4be16cfd64292f40
parentaf313201946a7e64f6985711136ef02f9113a8fc
usb: gadget: f_uac2: allow changing terminal types through configfs

Add "c_terminal_type" and "p_terminal_type" configfs entries
in order to allow the user to change the capture and playback terminal
type codes.

These fields affect the type of audio device that Windows detects, so
being able to modify this is useful when it would be advantageous for
a gadget to be detected as something other than a generic
speaker/microphone.

The fields default to microphone for the capture type field and speaker
for the playback type field as was the case before.

Signed-off-by: James Gruber <jimmyjgruber@gmail.com>
Link: https://lore.kernel.org/r/20230914222746.155126-1-jimmyjgruber@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/configfs-usb-gadget-uac2
Documentation/usb/gadget-testing.rst
drivers/usb/gadget/function/f_uac2.c
drivers/usb/gadget/function/u_uac2.h