Commit e882eae8 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Mark Brown

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: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent b9e0348f
...@@ -674,8 +674,9 @@ static int tps65911_get_voltage(struct regulator_dev *dev) ...@@ -674,8 +674,9 @@ static int tps65911_get_voltage(struct regulator_dev *dev)
step_mv = 100; step_mv = 100;
break; break;
case TPS65910_REG_VIO: case TPS65910_REG_VIO:
value &= LDO_SEL_MASK;
value >>= LDO_SEL_SHIFT;
return pmic->info[id]->voltage_table[value] * 1000; return pmic->info[id]->voltage_table[value] * 1000;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -767,9 +768,11 @@ static int tps65911_set_voltage(struct regulator_dev *dev, unsigned selector) ...@@ -767,9 +768,11 @@ static int tps65911_set_voltage(struct regulator_dev *dev, unsigned selector)
case TPS65911_REG_LDO6: case TPS65911_REG_LDO6:
case TPS65911_REG_LDO7: case TPS65911_REG_LDO7:
case TPS65911_REG_LDO8: case TPS65911_REG_LDO8:
case TPS65910_REG_VIO:
return tps65910_modify_bits(pmic, reg, return tps65910_modify_bits(pmic, reg,
(selector << LDO_SEL_SHIFT), LDO3_SEL_MASK); (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; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment