Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140251
b: refs/heads/master
c: a308466
h: refs/heads/master
i:
  140249: a1d579f
  140247: 67ca75d
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Mar 31, 2009
1 parent 620a44b commit 0bf902d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe203ddfa5451a13589b1c7da9edab80b7fc06d1
refs/heads/master: a308466c24b4f42bab6945026e938874d22cde50
17 changes: 17 additions & 0 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,23 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}

if (constraints->initial_mode) {
if (!ops->set_mode) {
printk(KERN_ERR "%s: no set_mode operation for %s\n",
__func__, name);
ret = -EINVAL;
goto out;
}

ret = ops->set_mode(rdev, constraints->initial_mode);
if (ret < 0) {
printk(KERN_ERR
"%s: failed to set initial mode for %s: %d\n",
__func__, name, ret);
goto out;
}
}

/* if always_on is set then turn the regulator on if it's not
* already on. */
if (constraints->always_on && ops->enable &&
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/regulator/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct regulator_state {
* @state_standby: State for regulator when system is suspended in standby
* mode.
* @initial_state: Suspend state to set by default.
* @initial_mode: Mode to set at startup.
*/
struct regulation_constraints {

Expand Down Expand Up @@ -111,6 +112,9 @@ struct regulation_constraints {
struct regulator_state state_standby;
suspend_state_t initial_state; /* suspend state to set at init */

/* mode to set on startup */
unsigned int initial_mode;

/* constriant flags */
unsigned always_on:1; /* regulator never off when system is on */
unsigned boot_on:1; /* bootloader/firmware enabled regulator */
Expand Down

0 comments on commit 0bf902d

Please sign in to comment.