static int ohci_brcm_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); 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. */ spin_lock_irqsave(&ohci->lock, flags); if (hcd->state != HC_STATE_SUSPENDED) { rc = -EINVAL; goto bail; } ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); (void)ohci_readl(ohci, &ohci->regs->intrdisable); brcm_usb_suspend(hcd); bail: spin_unlock_irqrestore(&ohci->lock, flags); return rc; }
static int ehci_brcm_suspend(struct usb_hcd *hcd) { int ret; ret = ehci_bus_suspend(hcd); ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd), false); brcm_usb_suspend(hcd); return ret; }