summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-02-17 18:56:11 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-11 20:48:41 +0000
commite882eae80f37fac922c6faa25e5ba535f29f2d38 (patch)
treeed408e10fefa6e2232087fef6a7b721fff8d35f5
parentb9e0348f2051358318e5ef0fd5b91c4d335a370d (diff)
downloadlwn-e882eae80f37fac922c6faa25e5ba535f29f2d38.tar.gz
lwn-e882eae80f37fac922c6faa25e5ba535f29f2d38.zip
regulator: tps65910: Correct VIO voltage configuration
The VIO regulator register specify the voltage configuration on bit3:2 of its register. And hence only these bits should be modified when setting voltage and used when reading voltage from register setting. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/tps65910-regulator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 9092b7f998c1..a9bb6d45ceff 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -674,8 +674,9 @@ static int tps65911_get_voltage(struct regulator_dev *dev)
step_mv = 100;
break;
case TPS65910_REG_VIO:
+ value &= LDO_SEL_MASK;
+ value >>= LDO_SEL_SHIFT;
return pmic->info[id]->voltage_table[value] * 1000;
- break;
default:
return -EINVAL;
}
@@ -767,9 +768,11 @@ static int tps65911_set_voltage(struct regulator_dev *dev, unsigned selector)
case TPS65911_REG_LDO6:
case TPS65911_REG_LDO7:
case TPS65911_REG_LDO8:
- case TPS65910_REG_VIO:
return tps65910_modify_bits(pmic, reg,
(selector << LDO_SEL_SHIFT), LDO3_SEL_MASK);
+ case TPS65910_REG_VIO:
+ return tps65910_modify_bits(pmic, reg,
+ (selector << LDO_SEL_SHIFT), LDO_SEL_MASK);
}
return -EINVAL;