From 50642709f6590fe40afa6d22c32f23f5b842aed5 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 1 Sep 2020 10:33:48 +0800 Subject: usb: cdns3: core: quit if it uses role switch class If the board uses role switch class for switching the role, it should not depends on SoC OTG hardware siginal any more, so quit early. Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi --- drivers/usb/cdns3/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 4c1445cf2ad0..a0f73d4711ae 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -280,6 +280,10 @@ int cdns3_hw_role_switch(struct cdns3 *cdns) enum usb_role real_role, current_role; int ret = 0; + /* Depends on role switch class */ + if (cdns->role_sw) + return 0; + pm_runtime_get_sync(cdns->dev); current_role = cdns->role; -- cgit v1.2.3