]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: typec: intel_pmc_mux: enable sysfs usb role access
authorUday M Bhat <uday.m.bhat@intel.com>
Wed, 6 Sep 2023 07:27:17 +0000 (12:57 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Oct 2023 11:54:42 +0000 (13:54 +0200)
The OS, such as ChromeOS, uses Android Runtime to run Android applications.
This necessitates supporting tools, for example, Android Debugger (ADB).
On host to host setup xHC.DbC shall support ADB with USB. This requires
user space to control USB roles.

Enable user space control to modify the USB Type-C role. At run time
it will create a role attribute in /sys/class/usb_role/<switch>/.
Attribute can be modified based on the values suggested in the
Documentation/ABI/testing/sysfs-class-usb_role.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Link: https://lore.kernel.org/r/20230906072717.32485-1-uday.m.bhat@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux/intel_pmc_mux.c

index 60ed1f809130d8b35a527581677b2229e42b5112..12a4f49e870e83d9c48982f5ffa5e4c7276370a9 100644 (file)
@@ -599,6 +599,7 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
        desc.driver_data = port;
        desc.name = fwnode_get_name(fwnode);
        desc.set = pmc_usb_set_role;
+       desc.allow_userspace_control = true;
 
        port->usb_sw = usb_role_switch_register(pmc->dev, &desc);
        if (IS_ERR(port->usb_sw)) {