aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-06-01 14:15:16 -0400
committerMark Brown <broonie@linaro.org>2014-06-01 14:16:11 -0400
commite953583456005823d7c20fefe5212f0f60a93fb6 (patch)
treef8849caebda4409c190f565e5ca24f9898eba03f
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
regulator: Don't disable unused regulators we don't have permission for
In the spirit of conservatism that governs our general approach to permissions it is better if we don't touch regulators we weren't explicitly given permissions to control. This avoids the need to explicitly specify unknown regulators in DT as always on, if a regulator is not otherwise involved in software control it can be omitted from the DT. Regulators explicitly given constraints in DT still need to have an always on constraint specified as before. Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9a09f3cdbabb..e3cb9b66731f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3819,8 +3819,9 @@ static int __init regulator_init_complete(void)
3819 mutex_lock(&regulator_list_mutex); 3819 mutex_lock(&regulator_list_mutex);
3820 3820
3821 /* If we have a full configuration then disable any regulators 3821 /* If we have a full configuration then disable any regulators
3822 * which are not in use or always_on. This will become the 3822 * we have permission to change the status for and which are
3823 * default behaviour in the future. 3823 * not in use or always_on. This is effectively the default
3824 * for DT and ACPI as they have full constraints.
3824 */ 3825 */
3825 list_for_each_entry(rdev, &regulator_list, list) { 3826 list_for_each_entry(rdev, &regulator_list, list) {
3826 ops = rdev->desc->ops; 3827 ops = rdev->desc->ops;
@@ -3829,6 +3830,9 @@ static int __init regulator_init_complete(void)
3829 if (c && c->always_on) 3830 if (c && c->always_on)
3830 continue; 3831 continue;
3831 3832
3833 if (c && !(c->valid_ops_mask & REGULATOR_CHANGE_STATUS))
3834 continue;
3835
3832 mutex_lock(&rdev->mutex); 3836 mutex_lock(&rdev->mutex);
3833 3837
3834 if (rdev->use_count) 3838 if (rdev->use_count)