diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 16:25:44 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 16:25:44 -0800 |
commit | c6c88bbde4d8b2ffe9886b7130b2e23781d424e5 (patch) | |
tree | 47c2b61983acc6fbc42d89813729b87bbaf2aed9 /drivers/usb/host/ehci-pci.c | |
parent | 0356dbb7fe87ba59558902e536d9f960e87353c1 (diff) | |
parent | c8dd7709c534ab0d713aa698c99132b6c812b57c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Diffstat (limited to 'drivers/usb/host/ehci-pci.c')
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 13f73a836e4..08ca0f849da 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -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. |