diff options
Diffstat (limited to 'drivers/usb/host/ohci-pxa27x.c')
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index b5294a9344de..f1c06202fdf2 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -481,38 +481,47 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) | |||
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | 483 | ||
484 | #ifdef CONFIG_PM | 484 | #ifdef CONFIG_PM |
485 | static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state) | 485 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) |
486 | { | 486 | { |
487 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 487 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
488 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); | 488 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); |
489 | 489 | ||
490 | if (time_before(jiffies, ohci->ohci.next_statechange)) | 490 | if (time_before(jiffies, ohci->ohci.next_statechange)) |
491 | msleep(5); | 491 | msleep(5); |
492 | ohci->ohci.next_statechange = jiffies; | 492 | ohci->ohci.next_statechange = jiffies; |
493 | 493 | ||
494 | pxa27x_stop_hc(ohci, &pdev->dev); | 494 | pxa27x_stop_hc(ohci, dev); |
495 | hcd->state = HC_STATE_SUSPENDED; | 495 | hcd->state = HC_STATE_SUSPENDED; |
496 | 496 | ||
497 | return 0; | 497 | return 0; |
498 | } | 498 | } |
499 | 499 | ||
500 | static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) | 500 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) |
501 | { | 501 | { |
502 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 502 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
503 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); | 503 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); |
504 | struct pxaohci_platform_data *inf = dev->platform_data; | ||
504 | int status; | 505 | int status; |
505 | 506 | ||
506 | if (time_before(jiffies, ohci->ohci.next_statechange)) | 507 | if (time_before(jiffies, ohci->ohci.next_statechange)) |
507 | msleep(5); | 508 | msleep(5); |
508 | ohci->ohci.next_statechange = jiffies; | 509 | ohci->ohci.next_statechange = jiffies; |
509 | 510 | ||
510 | if ((status = pxa27x_start_hc(ohci, &pdev->dev)) < 0) | 511 | if ((status = pxa27x_start_hc(ohci, dev)) < 0) |
511 | return status; | 512 | return status; |
512 | 513 | ||
514 | /* Select Power Management Mode */ | ||
515 | pxa27x_ohci_select_pmm(ohci, inf->port_mode); | ||
516 | |||
513 | ohci_finish_controller_resume(hcd); | 517 | ohci_finish_controller_resume(hcd); |
514 | return 0; | 518 | return 0; |
515 | } | 519 | } |
520 | |||
521 | static struct dev_pm_ops ohci_hcd_pxa27x_pm_ops = { | ||
522 | .suspend = ohci_hcd_pxa27x_drv_suspend, | ||
523 | .resume = ohci_hcd_pxa27x_drv_resume, | ||
524 | }; | ||
516 | #endif | 525 | #endif |
517 | 526 | ||
518 | /* work with hotplug and coldplug */ | 527 | /* work with hotplug and coldplug */ |
@@ -522,13 +531,12 @@ static struct platform_driver ohci_hcd_pxa27x_driver = { | |||
522 | .probe = ohci_hcd_pxa27x_drv_probe, | 531 | .probe = ohci_hcd_pxa27x_drv_probe, |
523 | .remove = ohci_hcd_pxa27x_drv_remove, | 532 | .remove = ohci_hcd_pxa27x_drv_remove, |
524 | .shutdown = usb_hcd_platform_shutdown, | 533 | .shutdown = usb_hcd_platform_shutdown, |
525 | #ifdef CONFIG_PM | ||
526 | .suspend = ohci_hcd_pxa27x_drv_suspend, | ||
527 | .resume = ohci_hcd_pxa27x_drv_resume, | ||
528 | #endif | ||
529 | .driver = { | 534 | .driver = { |
530 | .name = "pxa27x-ohci", | 535 | .name = "pxa27x-ohci", |
531 | .owner = THIS_MODULE, | 536 | .owner = THIS_MODULE, |
537 | #ifdef CONFIG_PM | ||
538 | .pm = &ohci_hcd_pxa27x_pm_ops, | ||
539 | #endif | ||
532 | }, | 540 | }, |
533 | }; | 541 | }; |
534 | 542 | ||