diff options
author | Anand Gadiyar <gadiyar@ti.com> | 2010-05-06 10:39:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:45 -0400 |
commit | 572538dee7a4b25f3e77fdc11d20dbb753ecf367 (patch) | |
tree | a07d20075928c2baf071194b17af6a7fa01c1e9d /drivers | |
parent | 89842ae6515c49405e20c0629a6442b6885ad49d (diff) |
USB: ehci-omap: Fix resume failures after bus suspend
An undocumented "feature" in the OMAP3 EHCI controller causes
suspended ports to be taken out of suspend when the USBCMD.Run/Stop
bit is cleared (this bit is normally cleared when ehci_bus_suspend
is called).
This "feature" breaks suspend-resume if the root-hub is allowed
to suspend. (The controller thinks it is in resume, and the PHY
thinks it is still in suspend).
There is an undocumented register bit that can be used to disable
this feature and restore normal behavior. Set this bit so
suspend-resume can work normally.
Tested on OMAP3 SDPs with the NXP ISP1504 and NXP ISP1703 PHYs.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 992d963b91fc..8905ba4e482a 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -116,6 +116,8 @@ | |||
116 | #define OMAP_UHH_DEBUG_CSR (0x44) | 116 | #define OMAP_UHH_DEBUG_CSR (0x44) |
117 | 117 | ||
118 | /* EHCI Register Set */ | 118 | /* EHCI Register Set */ |
119 | #define EHCI_INSNREG04 (0xA0) | ||
120 | #define EHCI_INSNREG04_DISABLE_UNSUSPEND (1 << 5) | ||
119 | #define EHCI_INSNREG05_ULPI (0xA4) | 121 | #define EHCI_INSNREG05_ULPI (0xA4) |
120 | #define EHCI_INSNREG05_ULPI_CONTROL_SHIFT 31 | 122 | #define EHCI_INSNREG05_ULPI_CONTROL_SHIFT 31 |
121 | #define EHCI_INSNREG05_ULPI_PORTSEL_SHIFT 24 | 123 | #define EHCI_INSNREG05_ULPI_PORTSEL_SHIFT 24 |
@@ -382,6 +384,18 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd) | |||
382 | dev_dbg(omap->dev, "UHH setup done, uhh_hostconfig=%x\n", reg); | 384 | dev_dbg(omap->dev, "UHH setup done, uhh_hostconfig=%x\n", reg); |
383 | 385 | ||
384 | 386 | ||
387 | /* | ||
388 | * An undocumented "feature" in the OMAP3 EHCI controller, | ||
389 | * causes suspended ports to be taken out of suspend when | ||
390 | * the USBCMD.Run/Stop bit is cleared (for example when | ||
391 | * we do ehci_bus_suspend). | ||
392 | * This breaks suspend-resume if the root-hub is allowed | ||
393 | * to suspend. Writing 1 to this undocumented register bit | ||
394 | * disables this feature and restores normal behavior. | ||
395 | */ | ||
396 | ehci_omap_writel(omap->ehci_base, EHCI_INSNREG04, | ||
397 | EHCI_INSNREG04_DISABLE_UNSUSPEND); | ||
398 | |||
385 | if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) || | 399 | if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) || |
386 | (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) || | 400 | (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) || |
387 | (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)) { | 401 | (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)) { |