Commit 7736f11d authored by Colin Cross's avatar Colin Cross Committed by Liam Girdwood

regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs

The n_voltages initializer for the TWL6030_ADJUSTABLE_LDO macro is
off by one, causing the the highest supported voltage to be
unreachable.  Setting the machine constraints to only allow the
highest voltage causes errors:

machine_constraints_voltage: VAUX3_6030: unsupportable voltage constraints
twl_reg twl_reg.39: can't register VAUX3_6030, -22
twl_reg: probe of twl_reg.39 failed with error -22

This patch fixes the off by one error.  Tested by setting
VAUX3_6030 to 3.3V.
Signed-off-by: default avatarColin Cross <ccross@android.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 2ae3636b
...@@ -864,7 +864,7 @@ static struct regulator_ops twlsmps_ops = { ...@@ -864,7 +864,7 @@ static struct regulator_ops twlsmps_ops = {
.desc = { \ .desc = { \
.name = #label, \ .name = #label, \
.id = TWL6030_REG_##label, \ .id = TWL6030_REG_##label, \
.n_voltages = (max_mVolts - min_mVolts)/100, \ .n_voltages = (max_mVolts - min_mVolts)/100 + 1, \
.ops = &twl6030ldo_ops, \ .ops = &twl6030ldo_ops, \
.type = REGULATOR_VOLTAGE, \ .type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
......
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