ARM: tegra: usb: handle device connect in lp0
Krishna Yarlagadda [Tue, 14 Aug 2012 16:06:59 +0000 (21:06 +0530)]
When a otg cable is connected along with device during lp0
system will wakeup but might not complete device enumeration
before going back to lp0. In this case we have to handle pmc
disable.

Bug 1024456

Change-Id: I9acbf434e58776c3d58de1b28d442d6b20b256d0
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/123383
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

arch/arm/mach-tegra/tegra3_usb_phy.c

index af9eaab..b02e9b6 100644 (file)
@@ -1657,11 +1657,11 @@ static void utmi_phy_restore_start(struct tegra_usb_phy *phy)
        if (UTMIP_WALK_PTR_VAL(inst) & val) {
                phy->remote_wakeup = true;
        } else if(!phy->remote_wakeup) {
-               if (!((UTMIP_USBON_VAL(phy->inst) |
-                       UTMIP_USBOP_VAL(phy->inst)) & val)) {
-                               utmip_phy_disable_pmc_bus_ctrl(phy);
-               }
+               val = readl(pmc_base + PMC_SLEEP_CFG);
+               if (val & UTMIP_MASTER_ENABLE(inst))
+                       utmip_phy_disable_pmc_bus_ctrl(phy);
        }
+
        utmi_phy_enable_obs_bus(phy);
 }