diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-05-04 11:52:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:29:47 -0400 |
commit | 383975d765523a56dc43a6cd6d52e9b376800cf2 (patch) | |
tree | d6ecbfe620d7d5fba372211d7af185e7c44e5097 /drivers/usb/host/ohci-hcd.c | |
parent | 0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c (diff) |
USB: EHCI, OHCI: handover changes
This patch (as887) changes the way ehci-hcd and ohci-hcd handle a loss
of VBUS power during suspend. In order for the USB-persist facility
to work correctly, it is necessary for low- and full-speed devices
attached to a high-speed port to be handed back to the companion
controller during resume processing.
This entails three changes: adding code to ehci-hcd to perform the
handover, removing code from ohci-hcd to turn off ports during
root-hub reinit, and adding code to ohci-hcd to turn on ports during
PCI controller resume. (Other bus glue resume methods for platforms
supporting high-speed controllers would need a similar change, if any
existed.)
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index a66637e725f3..ce05e5f7bed6 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -510,15 +510,7 @@ static int ohci_run (struct ohci_hcd *ohci) | |||
510 | // flush the writes | 510 | // flush the writes |
511 | (void) ohci_readl (ohci, &ohci->regs->control); | 511 | (void) ohci_readl (ohci, &ohci->regs->control); |
512 | msleep(temp); | 512 | msleep(temp); |
513 | temp = roothub_a (ohci); | 513 | |
514 | if (!(temp & RH_A_NPS)) { | ||
515 | /* power down each port */ | ||
516 | for (temp = 0; temp < ohci->num_ports; temp++) | ||
517 | ohci_writel (ohci, RH_PS_LSDA, | ||
518 | &ohci->regs->roothub.portstatus [temp]); | ||
519 | } | ||
520 | // flush those writes | ||
521 | (void) ohci_readl (ohci, &ohci->regs->control); | ||
522 | memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); | 514 | memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); |
523 | 515 | ||
524 | /* 2msec timelimit here means no irqs/preempt */ | 516 | /* 2msec timelimit here means no irqs/preempt */ |
@@ -826,17 +818,8 @@ static int ohci_restart (struct ohci_hcd *ohci) | |||
826 | if ((temp = ohci_run (ohci)) < 0) { | 818 | if ((temp = ohci_run (ohci)) < 0) { |
827 | ohci_err (ohci, "can't restart, %d\n", temp); | 819 | ohci_err (ohci, "can't restart, %d\n", temp); |
828 | return temp; | 820 | return temp; |
829 | } else { | ||
830 | /* here we "know" root ports should always stay powered, | ||
831 | * and that if we try to turn them back on the root hub | ||
832 | * will respond to CSC processing. | ||
833 | */ | ||
834 | i = ohci->num_ports; | ||
835 | while (i--) | ||
836 | ohci_writel (ohci, RH_PS_PSS, | ||
837 | &ohci->regs->roothub.portstatus [i]); | ||
838 | ohci_dbg (ohci, "restart complete\n"); | ||
839 | } | 821 | } |
822 | ohci_dbg(ohci, "restart complete\n"); | ||
840 | return 0; | 823 | return 0; |
841 | } | 824 | } |
842 | #endif | 825 | #endif |