regulator: core: Add regulator_is_supported_voltage_tol()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 14 Nov 2012 07:47:10 +0000 (16:47 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 14 Nov 2012 10:41:14 +0000 (19:41 +0900)
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>
include/linux/regulator/consumer.h

index c43cd3556b1f5b789bae79de586f7e85a4cafacc..49415a23b2d8a27373b31242f42154163fa55b24 100644 (file)
@@ -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