diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-08-05 11:05:20 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-08 09:34:41 -0400 |
commit | 3f1965776f6ec769192400810b6260fe48301bbb (patch) | |
tree | af582e003095638d26ce7d0fee558d3f3a9b285b /include/linux/regulator/consumer.h | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
regulator: add a new API regulator_set_voltage_tol()
There are some use cases where a voltage range could be reasonably
specified by a target voltage and tolerance. Add a new API
regulator_set_voltage_tol() wrapping regulator_set_voltage() call
to ease the users.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regulator/consumer.h')
-rw-r--r-- | include/linux/regulator/consumer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index da339fd8c755..21603524bdb2 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -352,4 +352,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator, | |||
352 | 352 | ||
353 | #endif | 353 | #endif |
354 | 354 | ||
355 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | ||
356 | int new_uV, int tol_uV) | ||
357 | { | ||
358 | return regulator_set_voltage(regulator, | ||
359 | new_uV - tol_uV, new_uV + tol_uV); | ||
360 | } | ||
361 | |||
355 | #endif | 362 | #endif |