2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 02:34:01 +08:00

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.

Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
This commit is contained in:
Peter Chen 2020-03-31 16:10:02 +08:00 committed by Felipe Balbi
parent d9feef974e
commit 23d6dd6c2a

View File

@ -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)) {