diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-14 11:47:10 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-14 14:41:14 +0400 |
commit | fe1e43f7190da98b396265639845a6cc0d748aad (patch) | |
tree | 62b5c3afaaf3355a432c6c5e6bf0bf256c76349f /include/linux/regulator | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) | |
download | linux-fe1e43f7190da98b396265639845a6cc0d748aad.tar.xz |
regulator: core: Add regulator_is_supported_voltage_tol()
If consumers wish to set voltages based on a tolerance it stands to reason
that they will also want to query for support in the same manner.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/consumer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index c43cd3556b1f..49415a23b2d8 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -367,4 +367,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator, new_uV - tol_uV, new_uV + tol_uV); } +static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, + int target_uV, int tol_uV) +{ + return regulator_is_supported_voltage(regulator, + target_uV - tol_uV, + target_uV + tol_uV); +} + #endif |