Skip to content

Commit

Permalink
regulator: core: Add regulator_is_supported_voltage_tol()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Nov 14, 2012
1 parent 77b6706 commit fe1e43f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/linux/regulator/consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fe1e43f

Please sign in to comment.