static int ehci_rkhsic_pm_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
- bool wakeup = device_may_wakeup(dev);
+ bool do_wakeup = device_may_wakeup(dev);
+ int ret;
dev_dbg(dev, "ehci-rkhsic PM suspend\n");
+ ret = ehci_suspend(hcd, do_wakeup);
- /*
- * EHCI helper function has also the same check before manipulating
- * port wakeup flags. We do check here the same condition before
- * calling the same helper function to avoid bringing hardware
- * from Low power mode when there is no need for adjusting port
- * wakeup flags.
- */
- if (hcd->self.root_hub->do_remote_wakeup && !wakeup) {
- pm_runtime_resume(dev);
- ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd),
- wakeup);
- }
-
- return 0;
+ return ret;
}
static int ehci_rkhsic_pm_resume(struct device *dev)
struct usb_hcd *hcd = dev_get_drvdata(dev);
dev_dbg(dev, "ehci-rkhsic PM resume\n");
- ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd));
+ ehci_resume(hcd, false);
return 0;
}
#endif
static const struct dev_pm_ops ehci_rkhsic_dev_pm_ops = {
- .suspend = ehci_rkhsic_pm_suspend,
- .resume = ehci_rkhsic_pm_resume,
+ .suspend = ehci_rkhsic_pm_suspend,
+ .resume = ehci_rkhsic_pm_resume,
};
static struct platform_driver ehci_rkhsic_driver = {
static int ehci_rk_pm_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
- bool wakeup = device_may_wakeup(dev);
+ bool do_wakeup = device_may_wakeup(dev);
+ int ret;
dev_dbg(dev, "ehci-rockchip PM suspend\n");
- /*
- * EHCI helper function has also the same check before manipulating
- * port wakeup flags. We do check here the same condition before
- * calling the same helper function to avoid bringing hardware
- * from Low power mode when there is no need for adjusting port
- * wakeup flags.
- */
- if (hcd->self.root_hub->do_remote_wakeup && !wakeup) {
- pm_runtime_resume(dev);
- ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd),
- wakeup);
- }
+ ret = ehci_suspend(hcd, do_wakeup);
- return 0;
+ return ret;
}
static int ehci_rk_pm_resume(struct device *dev)
struct usb_hcd *hcd = dev_get_drvdata(dev);
dev_dbg(dev, "ehci-rockchip PM resume\n");
- ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd));
+ ehci_resume(hcd, false);
return 0;
}
#endif
static const struct dev_pm_ops ehci_rk_dev_pm_ops = {
- .suspend = ehci_rk_pm_suspend,
- .resume = ehci_rk_pm_resume,
+ .suspend = ehci_rk_pm_suspend,
+ .resume = ehci_rk_pm_resume,
};
static struct platform_driver ehci_rk_driver = {