Skip to content

Commit

Permalink
regulator: Don't disable unused regulators we don't have permission for
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Jun 1, 2014
1 parent c9eaa44 commit e953583
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3819,8 +3819,9 @@ static int __init regulator_init_complete(void)
mutex_lock(&regulator_list_mutex);

/* If we have a full configuration then disable any regulators
* which are not in use or always_on. This will become the
* default behaviour in the future.
* we have permission to change the status for and which are
* not in use or always_on. This is effectively the default
* for DT and ACPI as they have full constraints.
*/
list_for_each_entry(rdev, &regulator_list, list) {
ops = rdev->desc->ops;
Expand All @@ -3829,6 +3830,9 @@ static int __init regulator_init_complete(void)
if (c && c->always_on)
continue;

if (c && !(c->valid_ops_mask & REGULATOR_CHANGE_STATUS))
continue;

mutex_lock(&rdev->mutex);

if (rdev->use_count)
Expand Down

0 comments on commit e953583

Please sign in to comment.