]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: Define regulator_set_voltage_triplet()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 17 Aug 2015 02:46:51 +0000 (08:16 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 17 Aug 2015 19:54:01 +0000 (12:54 -0700)
commitc81436e20c781d8c0f8eac5884426c84fc95393d
tree4c89400bb45b766231b2359c36d40417b85e438d
parent9f982bb1128a7f4215b5eb0c7b858c42c74a38d9
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/regulator/consumer.h