From 8e6626c08ef0a8f99d716f5b8e6a0e2191616719 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 25 Aug 2010 00:35:41 +0530 Subject: [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 Reviewed-by: Aleksandr Frid Reviewed-by: Suresh Mangipudi Tested-by: Suresh Mangipudi Reviewed-by: Bharat Nihalani --- .../odm_kit/adaptations/pmu/tps6586x/nvodm_pmu_tps6586x.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'arch') 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: -- cgit v1.2.3