static int ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); if (device_may_wakeup(&pdev->dev)) enable_irq_wake(hcd->irq); /* * The integrated transceivers seem unable to notice disconnect, * reconnect, or wakeup without the 48 MHz clock active. so for * correctness, always discard connection state (using reset). * * REVISIT: some boards will be able to turn VBUS off... */ if (at91_suspend_entering_slow_clock()) { ohci_usb_reset (ohci); /* flush the writes */ (void) ohci_readl (ohci, &ohci->regs->control); at91_stop_clock(); } return 0; }
static int ohci_hcd_s5pv210_drv_suspend(struct platform_device *pdev, pm_message_t message) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); unsigned long flags; int rc = 0; /* Root hub was already suspended. Disable irq emission and * mark HW unaccessible, bail out if RH has been resumed. Use * the spinlock to properly synchronize with possible pending * RH suspend or resume activity. * * This is still racy as hcd->state is manipulated outside of * any locks =P But that will be a different fix. */ spin_lock_irqsave(&ohci->lock, flags); if (hcd->state != HC_STATE_SUSPENDED) { rc = -EINVAL; goto bail; } /* make sure snapshot being resumed re-enumerates everything */ if (message.event == PM_EVENT_PRETHAW) { ohci_usb_reset(ohci); } clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); s5pv210_stop_ohc(); bail: spin_unlock_irqrestore(&ohci->lock, flags); return rc; }
static void ohci_exynos_stop(struct usb_hcd *hcd) { struct ohci_hcd *ohci = hcd_to_ohci(hcd); ohci_dump(ohci, 1); if (quirk_nec(ohci)) flush_work_sync(&ohci->nec_work); ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); ohci_usb_reset(ohci); free_irq(hcd->irq, hcd); hcd->irq = 0; if (quirk_zfmicro(ohci)) del_timer(&ohci->unlink_watchdog); if (quirk_amdiso(ohci)) usb_amd_dev_put(); remove_debug_files(ohci); ohci_mem_cleanup(ohci); if (ohci->hcca) { dma_free_coherent(hcd->self.controller, sizeof *ohci->hcca, ohci->hcca, ohci->hcca_dma); ohci->hcca = NULL; ohci->hcca_dma = 0; } }
static int ohci_brcm_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); brcm_usb_resume(hcd); ohci_usb_reset(hcd_to_ohci(hcd)); ohci_finish_controller_resume(hcd); return 0; }
static int ohci_pci_resume(struct usb_hcd *hcd, bool hibernated) { set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); /* Make sure resume from hibernation re-enumerates everything */ if (hibernated) ohci_usb_reset(hcd_to_ohci(hcd)); ohci_finish_controller_resume(hcd); return 0; }