Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140262
b: refs/heads/master
c: cacf90f
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Mar 31, 2009
1 parent 13d8f5e commit a9d61a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 221a7c7c9c88bf9d3ea4e191b35c7da709ca30b7
refs/heads/master: cacf90f24e80cec9334f98e0377149f943fe9f16
13 changes: 4 additions & 9 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}

/* are we enabled at boot time by firmware / bootloader */
if (rdev->constraints->boot_on)
rdev->use_count = 1;

/* do we need to setup our suspend state */
if (constraints->initial_state) {
ret = suspend_prepare(rdev, constraints->initial_state);
Expand Down Expand Up @@ -808,11 +804,10 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}

/* if always_on is set then turn the regulator on if it's not
* already on. */
if (constraints->always_on && ops->enable &&
((ops->is_enabled && !ops->is_enabled(rdev)) ||
(!ops->is_enabled && !constraints->boot_on))) {
/* If the constraints say the regulator should be on at this point
* and we have control then make sure it is enabled.
*/
if ((constraints->always_on || constraints->boot_on) && ops->enable) {
ret = ops->enable(rdev);
if (ret < 0) {
printk(KERN_ERR "%s: failed to enable %s\n",
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/regulator/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ struct regulator_state {
*
* @always_on: Set if the regulator should never be disabled.
* @boot_on: Set if the regulator is enabled when the system is initially
* started.
* started. If the regulator is not enabled by the hardware or
* bootloader then it will be enabled when the constraints are
* applied.
* @apply_uV: Apply the voltage constraint when initialising.
*
* @input_uV: Input voltage for regulator when supplied by another regulator.
Expand Down

0 comments on commit a9d61a0

Please sign in to comment.