]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ehci-pci.c
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ehci-pci.c
index 13f73a836e455033c002c49d6efea2219262ac3d..08ca0f849dab03ddbf9688aeb1e77dd811dbf8c6 100644 (file)
@@ -210,7 +210,16 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
        /* Serial Bus Release Number is at PCI 0x60 offset */
        pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
 
-       /* REVISIT:  per-port wake capability (PCI 0x62) currently unused */
+       /* Workaround current PCI init glitch:  wakeup bits aren't
+        * being set from PCI PM capability.
+        */
+       if (!device_can_wakeup(&pdev->dev)) {
+               u16     port_wake;
+
+               pci_read_config_word(pdev, 0x62, &port_wake);
+               if (port_wake & 0x0001)
+                       device_init_wakeup(&pdev->dev, 1);
+       }
 
        retval = ehci_pci_reinit(ehci, pdev);
 done:
@@ -269,7 +278,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
        unsigned                port;
-       struct usb_device       *root = hcd->self.root_hub;
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
        int                     retval = -EINVAL;
 
@@ -303,13 +311,7 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
 
 restart:
        ehci_dbg(ehci, "lost power, restarting\n");
-       for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
-               port--;
-               if (!root->children [port])
-                       continue;
-               usb_set_device_state(root->children[port],
-                                       USB_STATE_NOTATTACHED);
-       }
+       usb_root_hub_lost_power(hcd->self.root_hub);
 
        /* Else reset, to cope with power loss or flush-to-storage
         * style "resume" having let BIOS kick in during reboot.