Skip to content

Commit fe1e43f

Browse files
committed
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>
1 parent 77b6706 commit fe1e43f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎include/linux/regulator/consumer.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator,
367367
new_uV - tol_uV, new_uV + tol_uV);
368368
}
369369

370+
static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
371+
int target_uV, int tol_uV)
372+
{
373+
return regulator_is_supported_voltage(regulator,
374+
target_uV - tol_uV,
375+
target_uV + tol_uV);
376+
}
377+
370378
#endif

0 commit comments

Comments
 (0)