diff options
author | Colin Cross <ccross@android.com> | 2011-05-27 15:25:27 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-30 08:50:45 -0400 |
commit | 7736f11dbadce33d3f12bf0e8114d0f1da5e8622 (patch) | |
tree | 510f652ee33d8906b81063cb7dd8e4355b926ac8 /drivers/regulator/twl-regulator.c | |
parent | 2ae3636b79aee1a69b2e84eff68bb123090796d3 (diff) |
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: Colin Cross <ccross@android.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/twl-regulator.c')
-rw-r--r-- | drivers/regulator/twl-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 87fe0f75a56e..503c2bc64c84 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
@@ -864,7 +864,7 @@ static struct regulator_ops twlsmps_ops = { | |||
864 | .desc = { \ | 864 | .desc = { \ |
865 | .name = #label, \ | 865 | .name = #label, \ |
866 | .id = TWL6030_REG_##label, \ | 866 | .id = TWL6030_REG_##label, \ |
867 | .n_voltages = (max_mVolts - min_mVolts)/100, \ | 867 | .n_voltages = (max_mVolts - min_mVolts)/100 + 1, \ |
868 | .ops = &twl6030ldo_ops, \ | 868 | .ops = &twl6030ldo_ops, \ |
869 | .type = REGULATOR_VOLTAGE, \ | 869 | .type = REGULATOR_VOLTAGE, \ |
870 | .owner = THIS_MODULE, \ | 870 | .owner = THIS_MODULE, \ |