diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 07:43:00 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 07:43:00 +0400 |
commit | adca48f7c61c53708a1f1ed567e0447ccb2b3b96 (patch) | |
tree | d1860df280202eb86a625bd3400eab02b819100a /drivers/regulator/core.c | |
parent | 9e218670737e01ef37bd1ac400482462049dfeff (diff) | |
parent | e1b0144f9997d3d52c46785143699d82dd525f1d (diff) | |
download | linux-adca48f7c61c53708a1f1ed567e0447ccb2b3b96.tar.xz |
Merge remote-tracking branch 'regulator/topic/min' into regulator-next
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 35c149bb2ad3..cd1b201c91e2 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1924,6 +1924,10 @@ int regulator_list_voltage_linear(struct regulator_dev *rdev, { if (selector >= rdev->desc->n_voltages) return -EINVAL; + if (selector < rdev->desc->linear_min_sel) + return 0; + + selector -= rdev->desc->linear_min_sel; return rdev->desc->min_uV + (rdev->desc->uV_step * selector); } @@ -2152,6 +2156,8 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev, if (ret < 0) return ret; + ret += rdev->desc->linear_min_sel; + /* Map back into a voltage to verify we're still in bounds */ voltage = rdev->desc->ops->list_voltage(rdev, ret); if (voltage < min_uV || voltage > max_uV) |