aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-05-26 18:32:38 -0700
committerColin Cross <ccross@android.com>2011-06-14 11:42:32 -0700
commit9f84abf988fd03f2a7e9cf7e97c3ceb9a93626bd (patch)
tree65038af5a83e1e0f151dcb747248ee0a7974729b /drivers/regulator
parent8817171b8fe28a02e6133d9841be4fb60a8ba4a8 (diff)
downloadkernel_samsung_tuna-9f84abf988fd03f2a7e9cf7e97c3ceb9a93626bd.tar.gz
kernel_samsung_tuna-9f84abf988fd03f2a7e9cf7e97c3ceb9a93626bd.tar.bz2
kernel_samsung_tuna-9f84abf988fd03f2a7e9cf7e97c3ceb9a93626bd.zip
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. Change-Id: I5072a0bb380374a61d167ed421b8549e7001c125 Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/twl-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 87fe0f75a56..503c2bc64c8 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -864,7 +864,7 @@ static struct regulator_ops twlsmps_ops = {
.desc = { \
.name = #label, \
.id = TWL6030_REG_##label, \
- .n_voltages = (max_mVolts - min_mVolts)/100, \
+ .n_voltages = (max_mVolts - min_mVolts)/100 + 1, \
.ops = &twl6030ldo_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \