提交 3f196577 编写于 作者: S Shawn Guo 提交者: Mark Brown

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: NShawn Guo <shawn.guo@linaro.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 0d7614f0
......@@ -352,4 +352,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator,
#endif
static inline int regulator_set_voltage_tol(struct regulator *regulator,
int new_uV, int tol_uV)
{
return regulator_set_voltage(regulator,
new_uV - tol_uV, new_uV + tol_uV);
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册