static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); bool do_wakeup = device_may_wakeup(dev); unsigned long flags; int rc = ohci_suspend(hcd, do_wakeup); if (rc) return rc; spin_lock_irqsave(&ohci->lock, flags); if (exynos_ohci->otg) exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); exynos_ohci_phy_disable(pdev); clk_disable_unprepare(exynos_ohci->clk); spin_unlock_irqrestore(&ohci->lock, flags); return 0; }
static int ohci_pci_suspend (struct pci_dev *dev, u32 state) { ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); extern int ohci_suspend(ohci_t *, u32); return ohci_suspend(ohci, state); }
static int ohci_pci_suspend(device_t self) { ohci_softc_t *sc = device_get_softc(self); int err; err = bus_generic_suspend(self); if (err) { return (err); } ohci_suspend(sc); return (0); }
static int st_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->platform_data; struct platform_device *pdev = to_platform_device(dev); bool do_wakeup = device_may_wakeup(dev); int ret; ret = ohci_suspend(hcd, do_wakeup); if (ret) return ret; if (pdata->power_suspend) pdata->power_suspend(pdev); return ret; }
static int ohci_omap_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); bool do_wakeup = device_may_wakeup(&pdev->dev); int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; ret = ohci_suspend(hcd, do_wakeup); if (ret) return ret; omap_ohci_clock_power(0); return ret; }
static int exynos_ohci_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data; struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev); struct usb_hcd *hcd = exynos_ohci->hcd; dev_dbg(dev, "%s\n", __func__); ohci_suspend(hcd, false); if (exynos_ohci->phy) pm_runtime_put_sync(exynos_ohci->phy->dev); else if (pdata->phy_suspend) pdata->phy_suspend(pdev, USB_PHY_TYPE_HOST); return 0; }
static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg) { struct device *dev = &pdev->dev; struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); bool do_wakeup = device_may_wakeup(dev); int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; ret = ohci_suspend(hcd, do_wakeup); if (ret) return ret; sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); return ret; }
static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct pxa27x_ohci *pxa_ohci = to_pxa27x_ohci(hcd); struct ohci_hcd *ohci = hcd_to_ohci(hcd); bool do_wakeup = device_may_wakeup(dev); int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; ret = ohci_suspend(hcd, do_wakeup); if (ret) return ret; pxa27x_stop_hc(pxa_ohci, dev); return ret; }
static int ohci_da8xx_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); bool do_wakeup = device_may_wakeup(&pdev->dev); int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; ret = ohci_suspend(hcd, do_wakeup); if (ret) return ret; ohci_da8xx_disable(hcd); hcd->state = HC_STATE_SUSPENDED; return ret; }