aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2020-03-02 16:53:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-04 11:12:50 +0100
commite5256194cb51ced7a2f656590f1e2132235d442c (patch)
tree473086f90ceca12fc5774061fe49748bd2b126e0 /include/linux/usb
parentusb: roles: Provide the switch drivers handle to the switch in the API (diff)
downloadlinux-dev-e5256194cb51ced7a2f656590f1e2132235d442c.tar.xz
linux-dev-e5256194cb51ced7a2f656590f1e2132235d442c.zip
usb: roles: Allow the role switches to be named
The switch devices have been named by using the name of the parent device as base for now, but if for example the parent device controls multiple muxes, that will not work. Adding an optional member "name" to the switch descriptor that can be used for naming the switch during registration. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20200302135353.56659-7-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/role.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/role.h b/include/linux/usb/role.h
index c028ba8029ad..0164fed31b06 100644
--- a/include/linux/usb/role.h
+++ b/include/linux/usb/role.h
@@ -27,6 +27,7 @@ typedef enum usb_role (*usb_role_switch_get_t)(struct usb_role_switch *sw);
* @get: Callback for getting the role (optional)
* @allow_userspace_control: If true userspace may change the role through sysfs
* @driver_data: Private data pointer
+ * @name: Name for the switch (optional)
*
* @usb2_port and @usb3_port will point to the USB host port and @udc to the USB
* device controller behind the USB connector with the role switch. If
@@ -43,6 +44,7 @@ struct usb_role_switch_desc {
usb_role_switch_get_t get;
bool allow_userspace_control;
void *driver_data;
+ const char *name;
};