summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2010-08-25 00:35:41 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-08-30 00:50:21 -0700
commit8e6626c08ef0a8f99d716f5b8e6a0e2191616719 (patch)
tree90adedffe071cede652b5c99a54a83b8273111ed
parent7741beea207d8c45514ebb27e71056a672efbd84 (diff)
[odm/pmu] tps6586: Fixing external rail control issue.
The external power rail Ext_TPS74201PmuSupply_LDO is controlled by the gpio 1 of the tps6586. When gpio output is set to 0, the rail output is ON and when gpio output is set to 1, the rail output is OFF. As the api provides the control of these external rails through tps6586, the gpio output control should be on the desired value of external rails. Also by default power on, the external power rail Ext_TPS74201PmuSupply_LDO is ON so making it OFF as part of pmu setup. Change-Id: I05e2700afc719065f723b6f78b8cef829dcd4e53 Reviewed-on: http://git-master/r/5558 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c
index 0a4769ae8866..d16d22d35a1e 100644
--- a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c
+++ b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c
@@ -873,9 +873,12 @@ Tps6586xSetExternalSupply(
if (!Tps6586xI2cWrite8(hDevice, TPS6586x_R5D_GPIOSET1, data))
return NV_FALSE;
- if (Enable)
+ /* To enable the external power rail, it is require to make
+ the gpio output low. And to disable the external power
+ rail, it is require to make the gpio output high. */
+ if (!Enable)
{
- // Enable output
+ // Make gpio output to High for disabling external supply.
if (!Tps6586xI2cRead8(hDevice, TPS6586x_R5E_GPIOSET2, &data))
return NV_FALSE;
@@ -886,7 +889,7 @@ Tps6586xSetExternalSupply(
}
else
{
- // Disable output
+ // Make gpio output to Low for enable external supply.
if (!Tps6586xI2cRead8(hDevice, TPS6586x_R5E_GPIOSET2, &data))
return NV_FALSE;
@@ -1486,6 +1489,12 @@ NvBool Tps6586xSetup(NvOdmPmuDeviceHandle hDevice)
pmuStatus.batFull = NV_FALSE;
}
+ // By default some of external rails are ON, making them OFF.
+ hPmu->supplyRefCntTable[Ext_TPS74201PmuSupply_LDO] = 1;
+ if (NV_FALSE == Tps6586xWriteVoltageReg(hDevice, Ext_TPS74201PmuSupply_LDO,
+ ODM_VOLTAGE_OFF, NULL))
+ NVODMPMU_PRINTF(("TPS: Fail to set Ext_TPS74201PmuSupply_LDO OFF\n"));
+
return NV_TRUE;
OPEN_FAILED: