static int ehci_brcm_resume(struct usb_hcd *hcd) { int ret = 0; brcm_usb_resume(hcd); if (brcm_pm_deep_sleep()) { struct ehci_hcd *ehci = hcd_to_ehci(hcd); usb_root_hub_lost_power(hcd->self.root_hub); /* * SWLINUX-1705: Avoid OUT packet underflows during high memory * bus usage * port_status[0x0f] = Broadcom-proprietary USB_EHCI_INSNREG00 * @ 0x90 */ ehci_writel(ehci, 0x00800040, &ehci->regs->port_status[0x10]); ehci_writel(ehci, 0x00000001, &ehci->regs->port_status[0x12]); (void)ehci_halt(ehci); (void)ehci_reset(ehci); ehci_writel(ehci, ehci->command, &ehci->regs->command); ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag); /* unblock posted writes */ ehci_readl(ehci, &ehci->regs->command); ehci_writel(ehci, 0, &ehci->regs->intr_enable); /* re-init operational registers */ ehci_writel(ehci, 0, &ehci->regs->segment); ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list); ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next); /* restore CMD_RUN, framelist size, and irq threshold */ ehci_writel(ehci, ehci->command, &ehci->regs->command); /* Some controller/firmware combinations need a delay during * which they set up the port statuses. See Bugzilla #8190. */ /* SWLINUX-1929 need extra delay here */ msleep(10); ehci->next_statechange = jiffies + msecs_to_jiffies(5); hcd->state = HC_STATE_RUNNING; /* Now we can safely re-enable irqs */ ehci_writel(ehci, INTR_MASK, &ehci->regs->intr_enable); /* here we "know" root ports should always stay powered */ ehci_port_power(ehci, 1); return 0; } ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd)); ret = ehci_bus_resume(hcd); return ret; }
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; }