]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
regulator: core: Propagate voltage changes to supply regulators
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 20 Oct 2015 12:37:28 +0000 (14:37 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 22 Oct 2015 12:34:11 +0000 (13:34 +0100)
commitfc42112c0eaa6fc7c7fe61f8c6fb91b204b4d31d
tree17690576a12144fbaa47315e72c4c0c6175efd68
parent2098bf215f85fd92175bd9f851cfdc5df5b736e4
regulator: core: Propagate voltage changes to supply regulators

Until now changing the voltage of a regulator only ever effected the
regulator itself, but never its supplies. It's a common pattern though
to put LDO regulators behind switching regulators. The switching
regulators efficiently drop the input voltage but have a high ripple on
their output. The output is then cleaned up by the LDOs. For higher
energy efficiency the voltage drop at the LDOs should be minimized. For
this scenario we need to propagate the voltage change to the supply
regulators. Another scenario where voltage propagation is desired is
a regulator which only consists of a switch and thus cannot regulate
voltages itself. In this case we can pass setting voltages to the
supply.

This patch adds support for voltage propagation. We do voltage
propagation when the current regulator has a minimum dropout voltage
specified or if the current regulator lacks a get_voltage operation
(indicating it's a switch and not a regulator).

Changing the supply voltage must be done carefully. When we are
increasing the current regulators output we must first increase the
supply voltage and then the regulator itself. When we are decreasing the
current regulators voltage we must decrease the supply voltage after
changing the current regulators voltage.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c