]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-pci.c
Driver core: fixed add_bind_files() definition
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-pci.c
index 1b09dde068e11085e08830edc0a38f29c733eeab..37e122812b6797ee7a934a0fecd3cd0eaab1406b 100644 (file)
@@ -35,7 +35,10 @@ ohci_pci_start (struct usb_hcd *hcd)
        struct ohci_hcd *ohci = hcd_to_ohci (hcd);
        int             ret;
 
-       if(hcd->self.controller && hcd->self.controller->bus == &pci_bus_type) {
+       /* REVISIT this whole block should move to reset(), which handles
+        * all the other one-time init.
+        */
+       if (hcd->self.controller) {
                struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
 
                /* AMD 756, for most chips (early revs), corrupts register
@@ -45,7 +48,8 @@ ohci_pci_start (struct usb_hcd *hcd)
                                && pdev->device == 0x740c) {
                        ohci->flags = OHCI_QUIRK_AMD756;
                        ohci_dbg (ohci, "AMD756 erratum 4 workaround\n");
-                       // also somewhat erratum 10 (suspend/resume issues)
+                       /* also erratum 10 (suspend/resume issues) */
+                       device_init_wakeup(&hcd->self.root_hub->dev, 0);
                }
 
                /* FIXME for some of the early AMD 760 southbridges, OHCI
@@ -88,6 +92,13 @@ ohci_pci_start (struct usb_hcd *hcd)
                        ohci_dbg (ohci,
                                "enabled Compaq ZFMicro chipset quirk\n");
                }
+
+               /* RWC may not be set for add-in PCI cards, since boot
+                * firmware probably ignored them.  This transfers PCI
+                * PM wakeup capabilities (once the PCI layer is fixed).
+                */
+               if (device_may_wakeup(&pdev->dev))
+                       ohci->hc_control |= OHCI_CTRL_RWC;
        }
 
        /* NOTE: there may have already been a first reset, to
@@ -124,6 +135,11 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
        }
        ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
        (void)ohci_readl(ohci, &ohci->regs->intrdisable);
+
+       /* 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);
  bail:
        spin_unlock_irqrestore (&ohci->lock, flags);
@@ -195,7 +211,7 @@ static const struct hc_driver ohci_pci_hc_driver = {
 
 static const struct pci_device_id pci_ids [] = { {
        /* handle any USB OHCI controller */
-       PCI_DEVICE_CLASS((PCI_CLASS_SERIAL_USB << 8) | 0x10, ~0),
+       PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_OHCI, ~0),
        .driver_data =  (unsigned long) &ohci_pci_hc_driver,
        }, { /* end: all zeroes */ }
 };