diff options
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 13f73a836e45..08ca0f849dab 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) | |||
210 | /* Serial Bus Release Number is at PCI 0x60 offset */ | 210 | /* Serial Bus Release Number is at PCI 0x60 offset */ |
211 | pci_read_config_byte(pdev, 0x60, &ehci->sbrn); | 211 | pci_read_config_byte(pdev, 0x60, &ehci->sbrn); |
212 | 212 | ||
213 | /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ | 213 | /* Workaround current PCI init glitch: wakeup bits aren't |
214 | * being set from PCI PM capability. | ||
215 | */ | ||
216 | if (!device_can_wakeup(&pdev->dev)) { | ||
217 | u16 port_wake; | ||
218 | |||
219 | pci_read_config_word(pdev, 0x62, &port_wake); | ||
220 | if (port_wake & 0x0001) | ||
221 | device_init_wakeup(&pdev->dev, 1); | ||
222 | } | ||
214 | 223 | ||
215 | retval = ehci_pci_reinit(ehci, pdev); | 224 | retval = ehci_pci_reinit(ehci, pdev); |
216 | done: | 225 | done: |
@@ -269,7 +278,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd) | |||
269 | { | 278 | { |
270 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 279 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
271 | unsigned port; | 280 | unsigned port; |
272 | struct usb_device *root = hcd->self.root_hub; | ||
273 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | 281 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); |
274 | int retval = -EINVAL; | 282 | int retval = -EINVAL; |
275 | 283 | ||
@@ -303,13 +311,7 @@ static int ehci_pci_resume(struct usb_hcd *hcd) | |||
303 | 311 | ||
304 | restart: | 312 | restart: |
305 | ehci_dbg(ehci, "lost power, restarting\n"); | 313 | ehci_dbg(ehci, "lost power, restarting\n"); |
306 | for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) { | 314 | usb_root_hub_lost_power(hcd->self.root_hub); |
307 | port--; | ||
308 | if (!root->children [port]) | ||
309 | continue; | ||
310 | usb_set_device_state(root->children[port], | ||
311 | USB_STATE_NOTATTACHED); | ||
312 | } | ||
313 | 315 | ||
314 | /* Else reset, to cope with power loss or flush-to-storage | 316 | /* Else reset, to cope with power loss or flush-to-storage |
315 | * style "resume" having let BIOS kick in during reboot. | 317 | * style "resume" having let BIOS kick in during reboot. |