Skip to contentSkip to conversation

usb: gadget: f_uac1: allow changing interface name via configfs

PATCH New Yunhao Tian 1 participant 2 messages Jan 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 usb: gadget: f_uac1: allow changing interface name via configfs

This adds "function_name" configfs entry to change string value of the iInterface field. This field will be shown in Windows' audio settings panel, so being able to change it is useful. It will default to "AC Interface" just as before if unchanged.

---
 .../ABI/testing/configfs-usb-gadget-uac1      |  1 +
 Documentation/usb/gadget-testing.rst          |  1 +
 drivers/usb/gadget/function/f_uac1.c          | 46 ++++++++++++++++++-
 drivers/usb/gadget/function/u_uac1.h          |  2 +
 4 files changed, 49 insertions(+), 1 deletion(-)
Documentation/ABI/testing/configfs-usb-gadget-uac1 +1 -0
index dd647d44d975..ca66623a7700 100644
@@ -23,4 +23,5 @@ Description:
 		p_volume_res	playback volume control resolution (in 1/256 dB)
 		req_number	the number of pre-allocated request
 				for both capture and playback
+		function_name	name of the interface
 		==========	===================================
Documentation/usb/gadget-testing.rst +1 -0
index c18113077889..2cdb59411929 100644
@@ -745,6 +745,7 @@ The uac2 function provides these attributes in its function directory:
 	p_volume_res     playback volume control resolution (in 1/256 dB)
 	req_number       the number of pre-allocated request for both capture
 	                 and playback
+    function_name    name of the interface
 	================ ====================================================
 
 The attributes have sane default values.
drivers/usb/gadget/function/f_uac1.c +45 -1

82 lines not on this page · raw message

drivers/usb/gadget/function/u_uac1.h +2 -0
index 589fae861141..c94b6da16b68 100644
@@ -51,6 +51,8 @@ struct f_uac1_opts {
 	int				req_number;
 	unsigned			bound:1;
 
+	char			function_name[32];
+
 	struct mutex			lock;
 	int				refcnt;
 };
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 usb: gadget: f_uac2: allow changing interface name via configfs

This adds "function_name" configfs entry to change string value of the iInterface field. This field will be shown in Windows' audio settings panel, so being able to change it is useful. It will default to "Source/Sink" just as before.

---
 .../ABI/testing/configfs-usb-gadget-uac2      |  1 +
 Documentation/usb/gadget-testing.rst          |  1 +
 drivers/usb/gadget/function/f_uac2.c          | 46 ++++++++++++++++++-
 drivers/usb/gadget/function/u_uac2.h          |  2 +
 4 files changed, 49 insertions(+), 1 deletion(-)
Documentation/ABI/testing/configfs-usb-gadget-uac2 +1 -0
index cfd160ff8b56..3524f2b8446a 100644
@@ -23,4 +23,5 @@ Description:
 		p_volume_min	playback volume control min value (in 1/256 dB)
 		p_volume_max	playback volume control max value (in 1/256 dB)
 		p_volume_res	playback volume control resolution (in 1/256 dB)
+		function_name	name of the interface
 		=========  ============================
Documentation/usb/gadget-testing.rst +1 -0
index 2cdb59411929..6df834f87bf2 100644
@@ -934,6 +934,7 @@ The uac1 function provides these attributes in its function directory:
 	p_volume_res     playback volume control resolution (in 1/256 dB)
 	req_number       the number of pre-allocated request for both capture
 	                 and playback
+	function_name    name of the interface
 	================ ====================================================
 
 The attributes have sane default values.
drivers/usb/gadget/function/f_uac2.c +45 -1

82 lines not on this page · raw message

drivers/usb/gadget/function/u_uac2.h +2 -0
index a73b35774c44..4df23262db6e 100644
@@ -59,6 +59,8 @@ struct f_uac2_opts {
 	int				fb_max;
 	bool			bound;
 
+	char			function_name[32];
+
 	struct mutex			lock;
 	int				refcnt;
 };
Signature · 1 line
2.25.1