aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-msm.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-06-28 11:19:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-09 11:54:18 -0400
commitc5cf9212a368d88fe1e25797699b167f6daa64a5 (patch)
treecaaa246923f277de3a72e4d642f9fa914ba98a31 /drivers/usb/host/ehci-msm.c
parent336c5c310e8f0d5baba7973765339eaf5d989fe1 (diff)
EHCI: centralize controller suspend/resume
This patch (as1563) removes a lot of duplicated code by moving the EHCI controller suspend/resume routines into the core driver, where the various platform drivers can invoke them as needed. Not only does this simplify these platform drivers, this also makes it easier for other platform drivers to add suspend/resume support in the future. Note: The patch does not touch the ehci-fsl.c file, because its approach to suspend and resume is so different from all the others. It will have to be handled specially by its maintainer. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-msm.c')
-rw-r--r--drivers/usb/host/ehci-msm.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 6b4ffb598db1..17dd9e94001e 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -198,24 +198,11 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev)
198static int ehci_msm_pm_suspend(struct device *dev) 198static int ehci_msm_pm_suspend(struct device *dev)
199{ 199{
200 struct usb_hcd *hcd = dev_get_drvdata(dev); 200 struct usb_hcd *hcd = dev_get_drvdata(dev);
201 bool wakeup = device_may_wakeup(dev); 201 bool do_wakeup = device_may_wakeup(dev);
202 202
203 dev_dbg(dev, "ehci-msm PM suspend\n"); 203 dev_dbg(dev, "ehci-msm PM suspend\n");
204 204
205 /* 205 return ehci_suspend(hcd, do_wakeup);
206 * EHCI helper function has also the same check before manipulating
207 * port wakeup flags. We do check here the same condition before
208 * calling the same helper function to avoid bringing hardware
209 * from Low power mode when there is no need for adjusting port
210 * wakeup flags.
211 */
212 if (hcd->self.root_hub->do_remote_wakeup && !wakeup) {
213 pm_runtime_resume(dev);
214 ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd),
215 wakeup);
216 }
217
218 return 0;
219} 206}
220 207
221static int ehci_msm_pm_resume(struct device *dev) 208static int ehci_msm_pm_resume(struct device *dev)
@@ -223,7 +210,7 @@ static int ehci_msm_pm_resume(struct device *dev)
223 struct usb_hcd *hcd = dev_get_drvdata(dev); 210 struct usb_hcd *hcd = dev_get_drvdata(dev);
224 211
225 dev_dbg(dev, "ehci-msm PM resume\n"); 212 dev_dbg(dev, "ehci-msm PM resume\n");
226 ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd)); 213 ehci_resume(hcd, false);
227 214
228 return 0; 215 return 0;
229} 216}