ARM: tegra: usb: regulator on during lp0 on T20
Krishna Yarlagadda [Wed, 18 Jul 2012 11:34:33 +0000 (16:34 +0530)]
Tegra 2 requires regulator to be on during lp0

Bug 1012273

Change-Id: I750892fd391be327e617c70b7da4c984019a32fa
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/116743
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/usb_phy.c

index 62884df..4cc80e6 100644 (file)
@@ -405,6 +405,8 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
        }
 
        if (phy->vdd_reg) {
+               if (phy->vdd_reg_on)
+                       regulator_disable(phy->vdd_reg);
                regulator_put(phy->vdd_reg);
        }
 
@@ -470,17 +472,12 @@ int tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
                }
        }
 
-       if (phy->vdd_reg && phy->vdd_reg_on) {
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
-               regulator_disable(phy->vdd_reg);
-               phy->vdd_reg_on = false;
-#else
-               if (tegra_get_revision() >= TEGRA_REVISION_A03) {
+       if (phy->vdd_reg && phy->vdd_reg_on)
+               if (phy->pdata->has_hostpc ||
+                       phy->pdata->builtin_host_disabled) {
                        regulator_disable(phy->vdd_reg);
                        phy->vdd_reg_on = false;
                }
-#endif
-       }
 
        phy->phy_power_on = false;