diff options
author | Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> | 2018-09-14 11:31:36 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-28 14:57:03 +0100 |
commit | 18e4b55fbd2069cee51ef9660b35c65ec13bee6d (patch) | |
tree | 69c0b9d3796c30651bb669bd40cbd81ec9b3ad30 /drivers/regulator/core.c | |
parent | 01e17e5d8004f53044c6c9062e04ca118c420512 (diff) | |
download | linux-stable-18e4b55fbd2069cee51ef9660b35c65ec13bee6d.tar.gz |
regulator: Support regulators where voltage ranges are selectable
For example ROHM BD71837 and ROHM BD71847 Power management ICs have
regulators which provide multiple linear ranges. Ranges can be
selected by individual non contagious bit in vsel register. Add
regmap helper functions for selecting ranges.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 9577d8941846..4b1755a8ef00 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2783,6 +2783,11 @@ static int regulator_map_voltage(struct regulator_dev *rdev, int min_uV, if (desc->ops->list_voltage == regulator_list_voltage_linear_range) return regulator_map_voltage_linear_range(rdev, min_uV, max_uV); + if (desc->ops->list_voltage == + regulator_list_voltage_pickable_linear_range) + return regulator_map_voltage_pickable_linear_range(rdev, + min_uV, max_uV); + return regulator_map_voltage_iterate(rdev, min_uV, max_uV); } |