aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-au1xxx.c
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2009-07-29 13:13:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 09:46:29 -0400
commit807fcb5e19877d339a4cc56f2c6ddaf3a147457a (patch)
tree561c5309e691a40dfbceef34138d6766759ed59d /drivers/usb/host/ohci-au1xxx.c
parent64aebe73152ab3a9f5f426baaf65db632bd72c13 (diff)
USB: au1xxx: add dev_pm_ops
move both ohci-au1xxx and ehci-au1xxx over to dev_pm_ops. Tested on Au1200. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-au1xxx.c')
-rw-r--r--drivers/usb/host/ohci-au1xxx.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c
index 2ac4e022a13f..e4380082ebb1 100644
--- a/drivers/usb/host/ohci-au1xxx.c
+++ b/drivers/usb/host/ohci-au1xxx.c
@@ -248,10 +248,9 @@ static int ohci_hcd_au1xxx_drv_remove(struct platform_device *pdev)
248} 248}
249 249
250#ifdef CONFIG_PM 250#ifdef CONFIG_PM
251static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *pdev, 251static int ohci_hcd_au1xxx_drv_suspend(struct device *dev)
252 pm_message_t message)
253{ 252{
254 struct usb_hcd *hcd = platform_get_drvdata(pdev); 253 struct usb_hcd *hcd = dev_get_drvdata(dev);
255 struct ohci_hcd *ohci = hcd_to_ohci(hcd); 254 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
256 unsigned long flags; 255 unsigned long flags;
257 int rc; 256 int rc;
@@ -274,10 +273,6 @@ static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *pdev,
274 ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); 273 ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
275 (void)ohci_readl(ohci, &ohci->regs->intrdisable); 274 (void)ohci_readl(ohci, &ohci->regs->intrdisable);
276 275
277 /* make sure snapshot being resumed re-enumerates everything */
278 if (message.event == PM_EVENT_PRETHAW)
279 ohci_usb_reset(ohci);
280
281 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 276 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
282 277
283 au1xxx_stop_ohc(); 278 au1xxx_stop_ohc();
@@ -287,9 +282,9 @@ bail:
287 return rc; 282 return rc;
288} 283}
289 284
290static int ohci_hcd_au1xxx_drv_resume(struct platform_device *pdev) 285static int ohci_hcd_au1xxx_drv_resume(struct device *dev)
291{ 286{
292 struct usb_hcd *hcd = platform_get_drvdata(pdev); 287 struct usb_hcd *hcd = dev_get_drvdata(dev);
293 288
294 au1xxx_start_ohc(); 289 au1xxx_start_ohc();
295 290
@@ -298,20 +293,26 @@ static int ohci_hcd_au1xxx_drv_resume(struct platform_device *pdev)
298 293
299 return 0; 294 return 0;
300} 295}
296
297static struct dev_pm_ops au1xxx_ohci_pmops = {
298 .suspend = ohci_hcd_au1xxx_drv_suspend,
299 .resume = ohci_hcd_au1xxx_drv_resume,
300};
301
302#define AU1XXX_OHCI_PMOPS &au1xxx_ohci_pmops
303
301#else 304#else
302#define ohci_hcd_au1xxx_drv_suspend NULL 305#define AU1XXX_OHCI_PMOPS NULL
303#define ohci_hcd_au1xxx_drv_resume NULL
304#endif 306#endif
305 307
306static struct platform_driver ohci_hcd_au1xxx_driver = { 308static struct platform_driver ohci_hcd_au1xxx_driver = {
307 .probe = ohci_hcd_au1xxx_drv_probe, 309 .probe = ohci_hcd_au1xxx_drv_probe,
308 .remove = ohci_hcd_au1xxx_drv_remove, 310 .remove = ohci_hcd_au1xxx_drv_remove,
309 .shutdown = usb_hcd_platform_shutdown, 311 .shutdown = usb_hcd_platform_shutdown,
310 .suspend = ohci_hcd_au1xxx_drv_suspend,
311 .resume = ohci_hcd_au1xxx_drv_resume,
312 .driver = { 312 .driver = {
313 .name = "au1xxx-ohci", 313 .name = "au1xxx-ohci",
314 .owner = THIS_MODULE, 314 .owner = THIS_MODULE,
315 .pm = AU1XXX_OHCI_PMOPS,
315 }, 316 },
316}; 317};
317 318