usb: dwc3: core: allow pm runtime for rockchip platform

Most of rockchip platforms support power domain for dwc3.
Allow the pm runtime to manage the power domain for dwc3
in the dwc3 runtime PM routine.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I49e3fa207db8aea0355a797b69c9c8a791d2eaa3
This commit is contained in:
William Wu
2021-08-31 16:38:44 +08:00
parent 7e4881a49e
commit d8b7417bea
2 changed files with 17 additions and 1 deletions

View File

@@ -1642,7 +1642,14 @@ static int dwc3_probe(struct platform_device *pdev)
goto err5;
dwc3_debugfs_init(dwc);
pm_runtime_put(dev);
if (of_device_is_compatible(dev->parent->of_node,
"rockchip,rk3399-dwc3")) {
pm_runtime_allow(dev);
pm_runtime_put_sync_suspend(dev);
} else {
pm_runtime_put(dev);
}
return 0;

View File

@@ -2581,6 +2581,15 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
int ret = 0;
u32 reg;
/*
* If the DWC3 is in runtime suspend, the clocks maybe
* disabled, so avoid enable the DWC3 endpoints here.
* The DWC3 runtime PM resume routine will handle the
* gadget start sequence.
*/
if (pm_runtime_suspended(dwc->dev))
return ret;
/*
* Use IMOD if enabled via dwc->imod_interval. Otherwise, if
* the core supports IMOD, disable it.