usb: gadget: f_uac2: Expose all string descriptors through configfs.
Subsystems (2)
PATCH v3 1/1 usb: gadget: f_uac2: Expose all string descriptors through configfs.
From: Chris Wulff <[email protected]>
This makes all string descriptors configurable for the UAC2 gadget so the user can configure names of terminals and controls. Alt mode names are not included for now and will be in future work related to adding alternate settings.
discussion thread for api changes for alt mode settings:
https://lore.kernel.org/linux-usb/[email protected]/T/
---
v3:
Removed alt mode names (will be added in alt mode subdirectories later) Fixed up feature unit names to match alt settings discussion
Fixed direction of the names to match the c_/p_ semantics being device centric.
v2: Improved naming of parameters to be mode user friendly. Added documentation.
https://lore.kernel.org/all/CO1PR17MB54195BE778868AFDFE2DCB36E1112@CO1PR17MB5419.namprd17.prod.outlook.com/
--- .../ABI/testing/configfs-usb-gadget-uac2 | 11 +++ Documentation/usb/gadget-testing.rst | 11 +++ drivers/usb/gadget/function/f_uac2.c | 80 +++++++++++++++---- drivers/usb/gadget/function/u_uac2.h | 15 +++- 4 files changed, 99 insertions(+), 18 deletions(-)
Documentation/ABI/testing/configfs-usb-gadget-uac2 +11 -0
@@ -35,6 +35,17 @@ Description: req_number the number of pre-allocated requests for both capture and playback function_name name of the interface + if_ctrl_name topology control name + clksrc_in_name input clock name + clksrc_out_name output clock name + p_it_name playback input terminal name + p_it_ch_name playback input first channel name + p_ot_name playback output terminal name + p_fu_vol_name playback mute/volume function unit name + c_it_name capture input terminal name + c_it_ch_name capture input first channel name + c_ot_name capture output terminal name + c_fu_vol_name capture mute/volume functional unit name c_terminal_type code of the capture terminal type p_terminal_type code of the playback terminal type ===================== =======================================
Documentation/usb/gadget-testing.rst +11 -0
@@ -765,6 +765,17 @@ The uac2 function provides these attributes in its function directory: req_number the number of pre-allocated request for both capture and playback function_name name of the interface + if_ctrl_name topology control name + clksrc_in_name input clock name + clksrc_out_name output clock name + p_it_name playback input terminal name + p_it_ch_name playback input first channel name + p_ot_name playback output terminal name + p_fu_vol_name playback function unit name + c_it_name capture input terminal name + c_it_ch_name capture input first channel name + c_ot_name capture output terminal name + c_fu_vol_name capture functional unit name c_terminal_type code of the capture terminal type p_terminal_type code of the playback terminal type ================ ====================================================
drivers/usb/gadget/function/f_uac2.c +63 -17
130 lines not on this page · raw message
drivers/usb/gadget/function/u_uac2.h +14 -1
@@ -68,7 +68,20 @@ struct f_uac2_opts {int fb_max;bool bound; -char function_name[32 ]; +char function_name[USB_MAX_STRING_LEN ]; +char if_ctrl_name[USB_MAX_STRING_LEN ]; +char clksrc_in_name[USB_MAX_STRING_LEN ]; +char clksrc_out_name[USB_MAX_STRING_LEN ]; + +char p_it_name[USB_MAX_STRING_LEN ]; +char p_it_ch_name[USB_MAX_STRING_LEN ]; +char p_ot_name[USB_MAX_STRING_LEN ]; +char p_fu_vol_name[USB_MAX_STRING_LEN ]; + +char c_it_name[USB_MAX_STRING_LEN ]; +char c_it_ch_name[USB_MAX_STRING_LEN ]; +char c_ot_name[USB_MAX_STRING_LEN ]; +char c_fu_vol_name[USB_MAX_STRING_LEN ];s16 p_terminal_type;s16 c_terminal_type;
Signature · 1 line
2.43.0