diff options
author | Christian Engelmayer <christian.engelmayer@frequentis.com> | 2007-05-30 14:04:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:31 -0400 |
commit | 756aa6b3d536afe85e151138cb03a293998887b3 (patch) | |
tree | fd4b8d0efb2ef87bd4b3295086823246e76160f3 /drivers/usb/host/ehci-hub.c | |
parent | 648dcfc805ea1308552225e96113dc60e054f2f0 (diff) |
ehci-hub: improved over-current recovery
According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some root
hubs need port power to be cycled by software in order to get back
to normal functionality after an over-current condition ... like
the EHCI implementation on an MPC8343E.
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 27291f502651..71aeca019e88 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -647,9 +647,24 @@ static int ehci_hub_control ( | |||
647 | status |= 1 << USB_PORT_FEAT_C_CONNECTION; | 647 | status |= 1 << USB_PORT_FEAT_C_CONNECTION; |
648 | if (temp & PORT_PEC) | 648 | if (temp & PORT_PEC) |
649 | status |= 1 << USB_PORT_FEAT_C_ENABLE; | 649 | status |= 1 << USB_PORT_FEAT_C_ENABLE; |
650 | if ((temp & PORT_OCC) && !ignore_oc) | 650 | |
651 | if ((temp & PORT_OCC) && !ignore_oc){ | ||
651 | status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; | 652 | status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; |
652 | 653 | ||
654 | /* | ||
655 | * Hubs should disable port power on over-current. | ||
656 | * However, not all EHCI implementations do this | ||
657 | * automatically, even if they _do_ support per-port | ||
658 | * power switching; they're allowed to just limit the | ||
659 | * current. khubd will turn the power back on. | ||
660 | */ | ||
661 | if (HCS_PPC (ehci->hcs_params)){ | ||
662 | ehci_writel(ehci, | ||
663 | temp & ~(PORT_RWC_BITS | PORT_POWER), | ||
664 | status_reg); | ||
665 | } | ||
666 | } | ||
667 | |||
653 | /* whoever resumes must GetPortStatus to complete it!! */ | 668 | /* whoever resumes must GetPortStatus to complete it!! */ |
654 | if (temp & PORT_RESUME) { | 669 | if (temp & PORT_RESUME) { |
655 | 670 | ||