diff options
Diffstat (limited to 'drivers/usb/host/ohci-pci.c')
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 1843bb68ac7c..6afa7dc4e4c3 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -296,49 +296,6 @@ static int __devinit ohci_pci_start (struct usb_hcd *hcd) | |||
296 | return ret; | 296 | return ret; |
297 | } | 297 | } |
298 | 298 | ||
299 | #ifdef CONFIG_PM | ||
300 | |||
301 | static int ohci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) | ||
302 | { | ||
303 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | ||
304 | unsigned long flags; | ||
305 | int rc = 0; | ||
306 | |||
307 | /* Root hub was already suspended. Disable irq emission and | ||
308 | * mark HW unaccessible, bail out if RH has been resumed. Use | ||
309 | * the spinlock to properly synchronize with possible pending | ||
310 | * RH suspend or resume activity. | ||
311 | */ | ||
312 | spin_lock_irqsave (&ohci->lock, flags); | ||
313 | if (ohci->rh_state != OHCI_RH_SUSPENDED) { | ||
314 | rc = -EINVAL; | ||
315 | goto bail; | ||
316 | } | ||
317 | ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); | ||
318 | (void)ohci_readl(ohci, &ohci->regs->intrdisable); | ||
319 | |||
320 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | ||
321 | bail: | ||
322 | spin_unlock_irqrestore (&ohci->lock, flags); | ||
323 | |||
324 | return rc; | ||
325 | } | ||
326 | |||
327 | |||
328 | static int ohci_pci_resume(struct usb_hcd *hcd, bool hibernated) | ||
329 | { | ||
330 | set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | ||
331 | |||
332 | /* Make sure resume from hibernation re-enumerates everything */ | ||
333 | if (hibernated) | ||
334 | ohci_usb_reset(hcd_to_ohci(hcd)); | ||
335 | |||
336 | ohci_finish_controller_resume(hcd); | ||
337 | return 0; | ||
338 | } | ||
339 | |||
340 | #endif /* CONFIG_PM */ | ||
341 | |||
342 | 299 | ||
343 | /*-------------------------------------------------------------------------*/ | 300 | /*-------------------------------------------------------------------------*/ |
344 | 301 | ||
@@ -362,8 +319,8 @@ static const struct hc_driver ohci_pci_hc_driver = { | |||
362 | .shutdown = ohci_shutdown, | 319 | .shutdown = ohci_shutdown, |
363 | 320 | ||
364 | #ifdef CONFIG_PM | 321 | #ifdef CONFIG_PM |
365 | .pci_suspend = ohci_pci_suspend, | 322 | .pci_suspend = ohci_suspend, |
366 | .pci_resume = ohci_pci_resume, | 323 | .pci_resume = ohci_resume, |
367 | #endif | 324 | #endif |
368 | 325 | ||
369 | /* | 326 | /* |