From 0f2d776199ec3ae80623fdc5978d5a1ef3accb49 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 31 Mar 2020 16:10:02 +0800 Subject: [PATCH] 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 Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20200331081005.32752-1-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/cdns3/core.c | 2 ++ 1 file changed, 2 insertions(+) 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)) { -- 2.17.1