summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-08-29 20:38:36 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-08-30 19:28:59 -0700
commita2911a372b9eb4b61edf1967afa0aa3f894e679f (patch)
treea6962b8905c9d57d089d50629781588164e0eaae
parent803b43850ef1818570643f424c9d7d1215cd5771 (diff)
usb: host: tegra: selective phy suspend
The phy should not be powered off if the a device/hub is connected, Check if a device is connected before turning off the phy. Bug 867985 Change-Id: Id3ef2d39a04450028378350415848305448b693a Reviewed-on: http://git-master/r/49676 Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Ramachandrudu Kandhala <rkandhala@nvidia.com>
-rw-r--r--drivers/usb/host/ehci-tegra.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 829cd4b2925f..a67a5276b662 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -607,13 +607,18 @@ static int tegra_ehci_setup(struct usb_hcd *hcd)
#ifdef CONFIG_PM
static int tegra_ehci_bus_suspend(struct usb_hcd *hcd)
{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
+ u32 port_status;
int error_status = 0;
error_status = ehci_bus_suspend(hcd);
if (!error_status && tegra->power_down_on_bus_suspend) {
- tegra_usb_suspend(hcd, false);
- tegra->bus_suspended = 1;
+ port_status = ehci_readl(ehci, &ehci->regs->port_status[0]);
+ if (!port_status & PORT_CONNECT) {
+ tegra_usb_suspend(hcd, false);
+ tegra->bus_suspended = 1;
+ }
}
tegra_usb_phy_postsuspend(tegra->phy, false);