Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe1e43f7 authored by Mark Brown's avatar Mark Brown
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 77b67063
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -367,4 +367,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator,
				     new_uV - tol_uV, new_uV + tol_uV);
				     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
#endif