aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a87c0573c860..de1e689d3df0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -226,8 +226,13 @@ static int ehci_halt (struct ehci_hcd *ehci)
226 if ((temp & STS_HALT) != 0) 226 if ((temp & STS_HALT) != 0)
227 return 0; 227 return 0;
228 228
229 /*
230 * This routine gets called during probe before ehci->command
231 * has been initialized, so we can't rely on its value.
232 */
233 ehci->command &= ~CMD_RUN;
229 temp = ehci_readl(ehci, &ehci->regs->command); 234 temp = ehci_readl(ehci, &ehci->regs->command);
230 temp &= ~CMD_RUN; 235 temp &= ~(CMD_RUN | CMD_IAAD);
231 ehci_writel(ehci, temp, &ehci->regs->command); 236 ehci_writel(ehci, temp, &ehci->regs->command);
232 return handshake (ehci, &ehci->regs->status, 237 return handshake (ehci, &ehci->regs->status,
233 STS_HALT, STS_HALT, 16 * 125); 238 STS_HALT, STS_HALT, 16 * 125);
@@ -347,6 +352,7 @@ static int ehci_reset (struct ehci_hcd *ehci)
347 if (ehci->debug) 352 if (ehci->debug)
348 dbgp_external_startup(); 353 dbgp_external_startup();
349 354
355 ehci->command = ehci_readl(ehci, &ehci->regs->command);
350 ehci->port_c_suspend = ehci->suspended_ports = 356 ehci->port_c_suspend = ehci->suspended_ports =
351 ehci->resuming_ports = 0; 357 ehci->resuming_ports = 0;
352 return retval; 358 return retval;
@@ -363,16 +369,14 @@ static void ehci_quiesce (struct ehci_hcd *ehci)
363#endif 369#endif
364 370
365 /* wait for any schedule enables/disables to take effect */ 371 /* wait for any schedule enables/disables to take effect */
366 temp = ehci_readl(ehci, &ehci->regs->command) << 10; 372 temp = (ehci->command << 10) & (STS_ASS | STS_PSS);
367 temp &= STS_ASS | STS_PSS;
368 if (handshake_on_error_set_halt(ehci, &ehci->regs->status, 373 if (handshake_on_error_set_halt(ehci, &ehci->regs->status,
369 STS_ASS | STS_PSS, temp, 16 * 125)) 374 STS_ASS | STS_PSS, temp, 16 * 125))
370 return; 375 return;
371 376
372 /* then disable anything that's still active */ 377 /* then disable anything that's still active */
373 temp = ehci_readl(ehci, &ehci->regs->command); 378 ehci->command &= ~(CMD_ASE | CMD_PSE);
374 temp &= ~(CMD_ASE | CMD_IAAD | CMD_PSE); 379 ehci_writel(ehci, ehci->command, &ehci->regs->command);
375 ehci_writel(ehci, temp, &ehci->regs->command);
376 380
377 /* hardware can take 16 microframes to turn off ... */ 381 /* hardware can take 16 microframes to turn off ... */
378 handshake_on_error_set_halt(ehci, &ehci->regs->status, 382 handshake_on_error_set_halt(ehci, &ehci->regs->status,