Skip to content
Commit 30f93ca8 authored by Viresh Kumar's avatar Viresh Kumar Committed by Mark Brown
Browse files

regulator: core: Define regulator_set_voltage_triplet()



Voltage tolerance isn't necessarily same on both sides of the target
voltage and regulator_set_voltage_tol() wouldn't be suitable in such
cases.

Add another routine regulator_set_voltage_triplet(), which accepts
target, min and max voltages as arguments.

This first tries to set the voltage between the target voltage and the
upper limit, then fall back on the full range. The idea behind this is
to set regulator's voltage as close to the target voltage, as possible.

Based on regulator_set_voltage_tol().

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bc0195aa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment