summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps80031-regulator.c
diff options
context:
space:
mode:
authorMallikarjun Kasoju <mkasoju@nvidia.com>2012-07-17 16:04:01 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-07-30 12:26:40 +0530
commit9fa452aecee4fbc225287a1b741d677f263af9a5 (patch)
tree4df86eed98e519c2363a7cccb698064cd24e031f /drivers/regulator/tps80031-regulator.c
parente30360b8164477e2d1960c21ff9e8ec1c8ba749d (diff)
regulator: tps80031: adjust tolerance if req minuV > dev minuV
Adjust the tolerance voltage only when requested minimum voltage is more than the rail's minimum voltage. bug 997415 Change-Id: Ie139c657f8550adba07b74a0cd5d69e2b53d62c2 Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com> Reviewed-on: http://git-master/r/116405 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/regulator/tps80031-regulator.c')
-rw-r--r--drivers/regulator/tps80031-regulator.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/regulator/tps80031-regulator.c b/drivers/regulator/tps80031-regulator.c
index 937c0eaa95b2..e2ab5bfe0e4b 100644
--- a/drivers/regulator/tps80031-regulator.c
+++ b/drivers/regulator/tps80031-regulator.c
@@ -298,10 +298,11 @@ static int __tps80031_dcdc_set_voltage(struct device *parent,
int vsel = 0;
int ret;
- min_uV = min_uV - ri->tolerance_uv;
-
switch (ri->flags) {
case 0:
+ if (min_uV >= (607700 + ri->tolerance_uv))
+ min_uV = min_uV - ri->tolerance_uv;
+
if (min_uV == 0)
vsel = 0;
else if ((min_uV >= 607700) && (min_uV <= 1300000)) {
@@ -329,6 +330,8 @@ static int __tps80031_dcdc_set_voltage(struct device *parent,
break;
case DCDC_OFFSET_EN:
+ if (min_uV >= (700000 + ri->tolerance_uv))
+ min_uV = min_uV - ri->tolerance_uv;
if (min_uV == 0)
vsel = 0;
else if ((min_uV >= 700000) && (min_uV <= 1420000)) {
@@ -356,6 +359,8 @@ static int __tps80031_dcdc_set_voltage(struct device *parent,
break;
case DCDC_EXTENDED_EN:
+ if (min_uV >= (1852000 + ri->tolerance_uv))
+ min_uV = min_uV - ri->tolerance_uv;
if (min_uV == 0)
vsel = 0;
else if ((min_uV >= 1852000) && (max_uV <= 4013600)) {
@@ -367,6 +372,8 @@ static int __tps80031_dcdc_set_voltage(struct device *parent,
break;
case DCDC_OFFSET_EN|DCDC_EXTENDED_EN:
+ if (min_uV >= (2161000 + ri->tolerance_uv))
+ min_uV = min_uV - ri->tolerance_uv;
if (min_uV == 0)
vsel = 0;
else if ((min_uV >= 2161000) && (max_uV <= 4321000)) {