regulator: regulator_enable() permission checking
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 3 Aug 2009 17:49:57 +0000 (18:49 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 22 Sep 2009 12:32:41 +0000 (13:32 +0100)
commit9a2372fa7a403ba327873d0208a619d781a8a150
treea9b3b932420563fdebc9be6f7451aefb1df7fb6f
parent9332546fe88fa88bf6a7d9b1dce53ff5d314934e
regulator: regulator_enable() permission checking

The regulator_enable() code wasn't actually checking that the
machine constraints had given permission to enable the regulator.
Add code to do that, but only if the regulator is not already on
due to something like always_on or being left on at startup since
in those cases there's no physical change being introduced and the
constraint wouldn't make any sense.

Also add matching code for disable(). We need to do less there since
either regulator_enable() should have succeeded first or the board
setup makes no sense.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/core.c