mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user