diff options
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index bf2c8f65e1ae..4c32cb19b405 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -343,7 +343,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) | |||
343 | u32 temp; | 343 | u32 temp; |
344 | u32 power_okay; | 344 | u32 power_okay; |
345 | int i; | 345 | int i; |
346 | u8 resume_needed = 0; | 346 | unsigned long resume_needed = 0; |
347 | 347 | ||
348 | if (time_before (jiffies, ehci->next_statechange)) | 348 | if (time_before (jiffies, ehci->next_statechange)) |
349 | msleep(5); | 349 | msleep(5); |
@@ -416,7 +416,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) | |||
416 | if (test_bit(i, &ehci->bus_suspended) && | 416 | if (test_bit(i, &ehci->bus_suspended) && |
417 | (temp & PORT_SUSPEND)) { | 417 | (temp & PORT_SUSPEND)) { |
418 | temp |= PORT_RESUME; | 418 | temp |= PORT_RESUME; |
419 | resume_needed = 1; | 419 | set_bit(i, &resume_needed); |
420 | } | 420 | } |
421 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); | 421 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); |
422 | } | 422 | } |
@@ -431,8 +431,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) | |||
431 | i = HCS_N_PORTS (ehci->hcs_params); | 431 | i = HCS_N_PORTS (ehci->hcs_params); |
432 | while (i--) { | 432 | while (i--) { |
433 | temp = ehci_readl(ehci, &ehci->regs->port_status [i]); | 433 | temp = ehci_readl(ehci, &ehci->regs->port_status [i]); |
434 | if (test_bit(i, &ehci->bus_suspended) && | 434 | if (test_bit(i, &resume_needed)) { |
435 | (temp & PORT_SUSPEND)) { | ||
436 | temp &= ~(PORT_RWC_BITS | PORT_RESUME); | 435 | temp &= ~(PORT_RWC_BITS | PORT_RESUME); |
437 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); | 436 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); |
438 | ehci_vdbg (ehci, "resumed port %d\n", i + 1); | 437 | ehci_vdbg (ehci, "resumed port %d\n", i + 1); |
@@ -1046,7 +1045,19 @@ static int ehci_hub_control ( | |||
1046 | if (!selector || selector > 5) | 1045 | if (!selector || selector > 5) |
1047 | goto error; | 1046 | goto error; |
1048 | ehci_quiesce(ehci); | 1047 | ehci_quiesce(ehci); |
1048 | |||
1049 | /* Put all enabled ports into suspend */ | ||
1050 | while (ports--) { | ||
1051 | u32 __iomem *sreg = | ||
1052 | &ehci->regs->port_status[ports]; | ||
1053 | |||
1054 | temp = ehci_readl(ehci, sreg) & ~PORT_RWC_BITS; | ||
1055 | if (temp & PORT_PE) | ||
1056 | ehci_writel(ehci, temp | PORT_SUSPEND, | ||
1057 | sreg); | ||
1058 | } | ||
1049 | ehci_halt(ehci); | 1059 | ehci_halt(ehci); |
1060 | temp = ehci_readl(ehci, status_reg); | ||
1050 | temp |= selector << 16; | 1061 | temp |= selector << 16; |
1051 | ehci_writel(ehci, temp, status_reg); | 1062 | ehci_writel(ehci, temp, status_reg); |
1052 | break; | 1063 | break; |