From ed9e319dccfcdd8dbdc50a53c72281be6d5096f9 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Fri, 23 Dec 2011 19:13:06 +0530 Subject: 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 Change-Id: Id745cc82269282318cc064f25e789837dc0dfa7a Reviewed-on: http://git-master/r/72017 Reviewed-by: Laxman Dewangan Tested-by: Laxman Dewangan Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas --- drivers/regulator/tps80031-regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/regulator') 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) -- cgit v1.2.3