aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/core.c
diff options
context:
space:
mode:
authorPeter Chen <[email protected]>2020-03-31 08:10:02 +0000
committerGreg Kroah-Hartman <[email protected]>2020-04-16 13:31:35 +0000
commit0f2d776199ec3ae80623fdc5978d5a1ef3accb49 (patch)
treea8ca5ccbeb2e7e5f2eeb2419d4c9c0a643a86b62 /drivers/usb/cdns3/core.c
parentusb: phy: jz4770: Add a missing '\n' in a log message (diff)
downloadkernel-0f2d776199ec3ae80623fdc5978d5a1ef3accb49.tar.gz
kernel-0f2d776199ec3ae80623fdc5978d5a1ef3accb49.zip
usb: cdns3: core: get role switch node from firmware
After that, the role switch device (eg, Type-C device) could call cdns3_role_set to finish the role switch. Signed-off-by: Peter Chen <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/core.c')
-rw-r--r--drivers/usb/cdns3/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 4aafba20f450..704c679a0c5d 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -528,6 +528,8 @@ static int cdns3_probe(struct platform_device *pdev)
sw_desc.get = cdns3_role_get;
sw_desc.allow_userspace_control = true;
sw_desc.driver_data = cdns;
+ if (device_property_read_bool(dev, "usb-role-switch"))
+ sw_desc.fwnode = dev->fwnode;
cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
if (IS_ERR(cdns->role_sw)) {