summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Moganty <vmoganty@nvidia.com>2011-08-05 19:21:08 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-08-05 18:12:51 -0700
commit032b86dab0e0f38f2cc1321bc39803f7f5e08010 (patch)
treefe7085cff919aadf508b064893182b04cc3a8f6c
parenteb81b378963b209d5fcea63d44403c726532f712 (diff)
usb: ehci: tegra: Read port speed from hostpc register
During system suspend USB port speed need to be stored. If controller has hostpc then port speed should be read from the hostpc register instead of portsc. Bug 854000 Change-Id: Ic5c2c7eb11c923a64efe98f3b7006400db5ca50b Reviewed-on: http://git-master/r/45533 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--drivers/usb/host/ehci-tegra.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index ea43059fdb4d..71bc2b905b6b 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -44,6 +44,7 @@
#define STS_SRI (1<<7) /* SOF Recieved */
#define TEGRA_HSIC_CONNECTION_MAX_RETRIES 5
+#define HOSTPC_REG_OFFSET 0x1b4
struct tegra_ehci_hcd {
struct ehci_hcd *ehci;
@@ -369,7 +370,10 @@ static int tegra_usb_suspend(struct usb_hcd *hcd, bool is_dpd)
spin_lock_irqsave(&tegra->ehci->lock, flags);
- tegra->port_speed = (readl(&hw->port_status[0]) >> 26) & 0x3;
+ if (tegra->ehci->has_hostpc)
+ tegra->port_speed = (readl(hcd->regs + HOSTPC_REG_OFFSET) >> 25) & 0x3;
+ else
+ tegra->port_speed = (readl(&hw->port_status[0]) >> 26) & 0x3;
ehci_halt(tegra->ehci);
spin_unlock_irqrestore(&tegra->ehci->lock, flags);