aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-09-01 10:33:48 +0800
committerFelipe Balbi <balbi@kernel.org>2020-10-02 09:57:40 +0300
commit50642709f6590fe40afa6d22c32f23f5b842aed5 (patch)
tree919789eb6596300acd9462887ddeb858e8f4fe72 /drivers/usb/cdns3
parentusb: dwc3: pci: Allow Elkhart Lake to utilize DSM method for PM functionality (diff)
downloadlinux-dev-50642709f6590fe40afa6d22c32f23f5b842aed5.tar.xz
linux-dev-50642709f6590fe40afa6d22c32f23f5b842aed5.zip
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 <peter.chen@nxp.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/core.c4
1 files changed, 4 insertions, 0 deletions
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;