summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-16 19:36:33 +0000
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-03-31 09:56:29 +0100
commit50f075963f127d713ff0c30359baefc0f89d9ae2 (patch)
tree71530114cd1b39cd54e6ba39626b7fde2acb6f0f
parent52914eaa49bf732b091dbf5467ce4c7507c2d32a (diff)
downloadop-kernel-dev-50f075963f127d713ff0c30359baefc0f89d9ae2.zip
op-kernel-dev-50f075963f127d713ff0c30359baefc0f89d9ae2.tar.gz
regulator: Don't increment use_count for boot_on regulators
Don't set use_count for regulators that are enabled at boot since this stops the supply being disabled by well-behaved consumers which do balanced enables and disabled. Any consumers which don't do disables which are not matched by enables are unable to share regulators - shared regulators are the common case so the API should facilitate them. Consumers that want to disable regulators that are enabled when they start have two options: - Do a regulator_enable() prior to the disable to bring the use count in sync with the hardware state; this will ensure that if the regulator was enabled by another driver then this consumer will play nicely with it. - Use regulator_force_disable(); this explicitly bypasses any checks done by the core and documents the inability of the driver to share the supply. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/core.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9448875..8588a24 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -814,7 +814,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
rdev->constraints = NULL;
goto out;
}
- rdev->use_count = 1;
}
print_constraints(rdev);
OpenPOWER on IntegriCloud