diff options
Diffstat (limited to 'drivers/usb/host/ohci-omap.c')
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index e67c07dc426d..b3498b9b965f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -458,41 +458,29 @@ static int ohci_hcd_omap_drv_remove(struct device *dev) | |||
458 | static int ohci_omap_suspend(struct device *dev, pm_message_t message) | 458 | static int ohci_omap_suspend(struct device *dev, pm_message_t message) |
459 | { | 459 | { |
460 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 460 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); |
461 | int status = -EINVAL; | 461 | |
462 | 462 | if (time_before(jiffies, ohci->next_statechange)) | |
463 | down(&ohci_to_hcd(ohci)->self.root_hub->serialize); | 463 | msleep(5); |
464 | status = ohci_hub_suspend(ohci_to_hcd(ohci)); | 464 | ohci->next_statechange = jiffies; |
465 | if (status == 0) { | 465 | |
466 | omap_ohci_clock_power(0); | 466 | omap_ohci_clock_power(0); |
467 | ohci_to_hcd(ohci)->self.root_hub->state = | 467 | ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; |
468 | USB_STATE_SUSPENDED; | 468 | dev->power.power_state = PMSG_SUSPEND; |
469 | ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; | 469 | return 0; |
470 | dev->power.power_state = PMSG_SUSPEND; | ||
471 | } | ||
472 | up(&ohci_to_hcd(ohci)->self.root_hub->serialize); | ||
473 | return status; | ||
474 | } | 470 | } |
475 | 471 | ||
476 | static int ohci_omap_resume(struct device *dev) | 472 | static int ohci_omap_resume(struct device *dev) |
477 | { | 473 | { |
478 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 474 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); |
479 | int status = 0; | ||
480 | 475 | ||
481 | if (time_before(jiffies, ohci->next_statechange)) | 476 | if (time_before(jiffies, ohci->next_statechange)) |
482 | msleep(5); | 477 | msleep(5); |
483 | ohci->next_statechange = jiffies; | 478 | ohci->next_statechange = jiffies; |
479 | |||
484 | omap_ohci_clock_power(1); | 480 | omap_ohci_clock_power(1); |
485 | #ifdef CONFIG_USB_SUSPEND | 481 | dev->power.power_state = PMSG_ON; |
486 | /* get extra cleanup even if remote wakeup isn't in use */ | 482 | usb_hcd_resume_root_hub(dev_get_drvdata(dev)); |
487 | status = usb_resume_device(ohci_to_hcd(ohci)->self.root_hub); | 483 | return 0; |
488 | #else | ||
489 | down(&ohci_to_hcd(ohci)->self.root_hub->serialize); | ||
490 | status = ohci_hub_resume(ohci_to_hcd(ohci)); | ||
491 | up(&ohci_to_hcd(ohci)->self.root_hub->serialize); | ||
492 | #endif | ||
493 | if (status == 0) | ||
494 | dev->power.power_state = PMSG_ON; | ||
495 | return status; | ||
496 | } | 484 | } |
497 | 485 | ||
498 | #endif | 486 | #endif |