diff options
| author | Badhri Jagan Sridharan <Badhri@google.com> | 2017-09-15 19:17:27 -0700 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-23 23:43:36 +0200 |
| commit | 643282a43bfc2586f0867f57e53dfb618bee6590 (patch) | |
| tree | 67d7269fc49dc477fe7de4daa73415dd4d016b57 | |
| parent | 4ece79716068fb950623bcf20ffa77cc7b501eb6 (diff) | |
BACKPORT: usb: host: plat: Enable xHCI plat runtime PM
Enable the xHCI plat runtime PM for parent device to
suspend/resume xHCI.
https://patchwork.kernel.org/patch/9679003/
Leaving out the pm_runtime_forbid() as autosuspend
seems to be enabled in qualcomm's code.
BUG: 63697798
Change-Id: I5c1ce3ccc0a70cddce9c68def30c7bc54165f479
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
| -rw-r--r-- | drivers/usb/host/xhci-plat.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index efe1924e0875..be3fb06da516 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -208,7 +208,7 @@ static int xhci_plat_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - pm_runtime_get_sync(&pdev->dev); + pm_runtime_get_noresume(&pdev->dev); if (of_device_is_compatible(pdev->dev.of_node, "marvell,armada-375-xhci") || @@ -293,6 +293,8 @@ put_usb3_hcd: usb_put_hcd(xhci->shared_hcd); disable_clk: + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_disable(&pdev->dev); if (!IS_ERR(clk)) clk_disable_unprepare(clk); @@ -308,8 +310,6 @@ static int xhci_plat_remove(struct platform_device *dev) struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct clk *clk = xhci->clk; - pm_runtime_disable(&dev->dev); - device_remove_file(&dev->dev, &dev_attr_config_imod); xhci->xhc_state |= XHCI_STATE_REMOVING; usb_remove_hcd(xhci->shared_hcd); @@ -322,6 +322,9 @@ static int xhci_plat_remove(struct platform_device *dev) clk_disable_unprepare(clk); usb_put_hcd(hcd); + pm_runtime_set_suspended(&dev->dev); + pm_runtime_disable(&dev->dev); + return 0; } |
