aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/core.c13
-rw-r--r--include/linux/regulator/machine.h4
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 2ff76349f392..08441e24946e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -776,10 +776,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
776 } 776 }
777 } 777 }
778 778
779 /* are we enabled at boot time by firmware / bootloader */
780 if (rdev->constraints->boot_on)
781 rdev->use_count = 1;
782
783 /* do we need to setup our suspend state */ 779 /* do we need to setup our suspend state */
784 if (constraints->initial_state) { 780 if (constraints->initial_state) {
785 ret = suspend_prepare(rdev, constraints->initial_state); 781 ret = suspend_prepare(rdev, constraints->initial_state);
@@ -808,11 +804,10 @@ static int set_machine_constraints(struct regulator_dev *rdev,
808 } 804 }
809 } 805 }
810 806
811 /* if always_on is set then turn the regulator on if it's not 807 /* If the constraints say the regulator should be on at this point
812 * already on. */ 808 * and we have control then make sure it is enabled.
813 if (constraints->always_on && ops->enable && 809 */
814 ((ops->is_enabled && !ops->is_enabled(rdev)) || 810 if ((constraints->always_on || constraints->boot_on) && ops->enable) {
815 (!ops->is_enabled && !constraints->boot_on))) {
816 ret = ops->enable(rdev); 811 ret = ops->enable(rdev);
817 if (ret < 0) { 812 if (ret < 0) {
818 printk(KERN_ERR "%s: failed to enable %s\n", 813 printk(KERN_ERR "%s: failed to enable %s\n",
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 1eb861cf4b2c..5de7aa3b02a6 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -73,7 +73,9 @@ struct regulator_state {
73 * 73 *
74 * @always_on: Set if the regulator should never be disabled. 74 * @always_on: Set if the regulator should never be disabled.
75 * @boot_on: Set if the regulator is enabled when the system is initially 75 * @boot_on: Set if the regulator is enabled when the system is initially
76 * started. 76 * started. If the regulator is not enabled by the hardware or
77 * bootloader then it will be enabled when the constraints are
78 * applied.
77 * @apply_uV: Apply the voltage constraint when initialising. 79 * @apply_uV: Apply the voltage constraint when initialising.
78 * 80 *
79 * @input_uV: Input voltage for regulator when supplied by another regulator. 81 * @input_uV: Input voltage for regulator when supplied by another regulator.