diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-12-23 19:13:06 +0530 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-30 10:45:17 +0530 |
commit | ed9e319dccfcdd8dbdc50a53c72281be6d5096f9 (patch) | |
tree | 5cf8ef27522384fb0656bf37246e81484967c57e /drivers/regulator | |
parent | f291a073d551dfa671050340308cce49bc47402d (diff) |
regulator: tps80031: use correct voltage conversion formula
The correct voltage conversion formula for the register programming
is
Code=((Vout-0.6077)/0.01266)+1
Changing existing formula to above equation.
bug 915859
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Change-Id: Id745cc82269282318cc064f25e789837dc0dfa7a
Reviewed-on: http://git-master/r/72017
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/tps80031-regulator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/tps80031-regulator.c b/drivers/regulator/tps80031-regulator.c index 342809f31947..874abebd0e43 100644 --- a/drivers/regulator/tps80031-regulator.c +++ b/drivers/regulator/tps80031-regulator.c @@ -220,7 +220,7 @@ static int tps80031dcdc_list_voltage(struct regulator_dev *rdev, unsigned index) if (index == 0) voltage = 0; else if (index < 58) - voltage = (600000 + (12500 * (index - 1))); + voltage = (607700 + (12660 * (index - 1))); else if (index == 58) voltage = 1350 * 1000; else if (index == 59) @@ -300,8 +300,8 @@ static int __tps80031_dcdc_set_voltage(struct device *parent, case 0: if (min_uV == 0) vsel = 0; - else if ((min_uV >= 600000) && (max_uV <= 1300000)) { - vsel = (min_uV - 600000) / 125; + else if ((min_uV >= 607700) && (max_uV <= 1300000)) { + vsel = (10 * (min_uV - 607700)) / 1266; if (vsel % 100) vsel += 100; vsel /= 100; @@ -422,7 +422,7 @@ decode: if (vsel == 0) voltage = 0; else if (vsel < 58) - voltage = (600000 + (12500 * (vsel - 1))); + voltage = (607700 + (12660 * (vsel - 1))); else if (vsel == 58) voltage = 1350 * 1000; else if (vsel == 59) |