- /* Re-enable bus mastering */
- pci_set_master (to_pci_dev(ohci->hcd.self.controller));
-
- switch (temp) {
-
- case OHCI_USB_RESET: // lost power
-restart:
- ohci_info (ohci, "USB restart\n");
- retval = hc_restart (ohci);
- break;
-
- case OHCI_USB_SUSPEND: // host wakeup
- case OHCI_USB_RESUME: // remote wakeup
- ohci_info (ohci, "USB continue from %s wakeup\n",
- (temp == OHCI_USB_SUSPEND)
- ? "host" : "remote");
-
- /* we "should" only need RESUME if we're SUSPENDed ... */
- ohci->hc_control = OHCI_USB_RESUME;
- writel (ohci->hc_control, &ohci->regs->control);
- (void) readl (&ohci->regs->control);
- /* Some controllers (lucent) need extra-long delays */
- mdelay (35); /* no schedule here ! */
-
- temp = readl (&ohci->regs->control);
- temp = ohci->hc_control & OHCI_CTRL_HCFS;
- if (temp != OHCI_USB_RESUME) {
- ohci_err (ohci, "controller won't resume\n");
- /* maybe we can reset */
- goto restart;
- }
-
- /* Then re-enable operations */
- writel (OHCI_USB_OPER, &ohci->regs->control);
- (void) readl (&ohci->regs->control);
- mdelay (3);
-
- spin_lock_irq (&ohci->lock);
- ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
- if (!ohci->ed_rm_list) {
- if (ohci->ed_controltail)
- ohci->hc_control |= OHCI_CTRL_CLE;
- if (ohci->ed_bulktail)
- ohci->hc_control |= OHCI_CTRL_BLE;
- }
- if (hcd_to_bus (&ohci->hcd)->bandwidth_isoc_reqs
- || hcd_to_bus (&ohci->hcd)->bandwidth_int_reqs)
- ohci->hc_control |= OHCI_CTRL_PLE|OHCI_CTRL_IE;
- hcd->state = USB_STATE_RUNNING;
- writel (ohci->hc_control, &ohci->regs->control);
-
- /* trigger a start-frame interrupt (why?) */
- writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
- writel (OHCI_INTR_SF, &ohci->regs->intrenable);
-
- writel (OHCI_INTR_WDH, &ohci->regs->intrdisable);
- (void) readl (&ohci->regs->intrdisable);
- spin_unlock_irq (&ohci->lock);
-