regulator: core: enable power when setting up constraints
authorOlliver Schinagl <oliver@schinagl.nl>
Mon, 26 Nov 2018 15:27:44 +0000 (17:27 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 26 Nov 2018 16:39:24 +0000 (16:39 +0000)
commit2bb1666369339f69f227ad060c250afde94d5c69
tree4654c4663eb9ff12f10e787fd944a591bab8fe29
parentf1abf67217de91f5cd3c757ae857632ca565099a
regulator: core: enable power when setting up constraints

When a regulator is marked as always on, it is enabled early on, when
checking and setting up constraints. It makes the assumption that the
bootloader properly initialized the regulator, and just in case enables
the regulator anyway.

Some constraints however currently get missed, such as the soft-start
and ramp-delay. This causes the regulator to be enabled, without the
soft-start and ramp-delay being applied, which in turn can cause
high-currents or other start-up problems.

By moving the always-enabled constraints later in the constraints check,
we can at least ensure all constraints for the regulator are followed.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c