diff options
author | Li Jun <jun.li@nxp.com> | 2017-11-10 00:16:48 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 35c3f55de774488ee0cb29ac48e568274fca8b34 (patch) | |
tree | 4e8383ab5239102a4b9bee0f37faf506339c259c /drivers/usb/host | |
parent | ded239998fff934f8c46d385de38d11ba73ad8a8 (diff) |
MLK-16775-2 usb: xhci: plat: only do high bus freq for runtime pm
Remove xhci_suspend and xhci_resume as i.MX8MQ dwc3 can't support it,
add high bus request and release, and enable runtime pm by default.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-plat.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 63b62a85c00c..a0c28e1c0754 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -20,6 +20,7 @@ #include <linux/usb/phy.h> #include <linux/slab.h> #include <linux/acpi.h> +#include <linux/busfreq-imx.h> #include "xhci.h" #include "xhci-plat.h" @@ -263,6 +264,8 @@ static int xhci_plat_probe(struct platform_device *pdev) goto put_usb3_hcd; } + request_bus_freq(BUS_FREQ_HIGH); + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto disable_usb_phy; @@ -277,12 +280,6 @@ static int xhci_plat_probe(struct platform_device *pdev) device_enable_async_suspend(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); - /* - * Prevent runtime pm from being on as default, users should enable - * runtime pm using power/control in sysfs. - */ - pm_runtime_forbid(&pdev->dev); - return 0; @@ -291,6 +288,7 @@ dealloc_usb2_hcd: disable_usb_phy: usb_phy_shutdown(hcd->usb_phy); + release_bus_freq(BUS_FREQ_HIGH); put_usb3_hcd: usb_put_hcd(xhci->shared_hcd); @@ -329,6 +327,7 @@ static int xhci_plat_remove(struct platform_device *dev) pm_runtime_set_suspended(&dev->dev); pm_runtime_disable(&dev->dev); + release_bus_freq(BUS_FREQ_HIGH); return 0; } @@ -362,18 +361,14 @@ static int xhci_plat_resume(struct device *dev) #ifdef CONFIG_PM static int xhci_plat_runtime_suspend(struct device *dev) { - struct usb_hcd *hcd = dev_get_drvdata(dev); - struct xhci_hcd *xhci = hcd_to_xhci(hcd); - - return xhci_suspend(xhci, true); + release_bus_freq(BUS_FREQ_HIGH); + return 0; } static int xhci_plat_runtime_resume(struct device *dev) { - struct usb_hcd *hcd = dev_get_drvdata(dev); - struct xhci_hcd *xhci = hcd_to_xhci(hcd); - - return xhci_resume(xhci, 0); + request_bus_freq(BUS_FREQ_HIGH); + return 0; } #endif /* CONFIG_PM */ |