diff options
author | Yadwinder Singh Brar <yadi.brar01@gmail.com> | 2012-06-11 08:11:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-17 16:08:52 -0400 |
commit | 6f0b2c696ca340cc2da381fe693fda3f8fdb2149 (patch) | |
tree | 71814a0078daec92d97fd3a5651d083cfb424132 /include/linux/regulator | |
parent | b5fb77e0188dc85630b395eb0faddc4987be6ddb (diff) |
regulator: Add ramp_delay configuration to constraints
For some hardwares ramp_delay for BUCKs is a configurable parameter which can
be configured through DT or board file.This patch adds ramp_delay to regulator
constraints and allow user to configure it for regulators which supports this
feature, through DT or board file. It will provide two ways of setting the
ramp_delay for a regulator:
First, by setting it as constraints in board file(for configurable
regulators) and set_machine_constraints() will take care of setting it on
hardware by calling(the provided) .set_ramp_delay() operation(callback).
Second, by setting it as data in regulator_desc(as fixed/default
ramp_delay rate) for a regulator in driver.
regulator_set_voltage_time_sel() will give preference to
constraints->ramp_delay while reading ramp_delay rate for regulator. Similarly
users should also take care accordingly while refering ramp_delay rate(in case
of implementing their private .set_voltage_time_sel() callbacks for different
regulators).
[Rewrote subject for 80 columns -- broonie]
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/driver.h | 3 | ||||
-rw-r--r-- | include/linux/regulator/machine.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index ae5c25379237..ddc155d262da 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -67,6 +67,8 @@ enum regulator_status { | |||
67 | * | 67 | * |
68 | * @enable_time: Time taken for the regulator voltage output voltage to | 68 | * @enable_time: Time taken for the regulator voltage output voltage to |
69 | * stabilise after being enabled, in microseconds. | 69 | * stabilise after being enabled, in microseconds. |
70 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should | ||
71 | * select ramp delay equal to or less than(closest) ramp_delay. | ||
70 | * @set_voltage_time_sel: Time taken for the regulator voltage output voltage | 72 | * @set_voltage_time_sel: Time taken for the regulator voltage output voltage |
71 | * to stabilise after being set to a new value, in microseconds. | 73 | * to stabilise after being set to a new value, in microseconds. |
72 | * The function provides the from and to voltage selector, the | 74 | * The function provides the from and to voltage selector, the |
@@ -113,6 +115,7 @@ struct regulator_ops { | |||
113 | 115 | ||
114 | /* Time taken to enable or set voltage on the regulator */ | 116 | /* Time taken to enable or set voltage on the regulator */ |
115 | int (*enable_time) (struct regulator_dev *); | 117 | int (*enable_time) (struct regulator_dev *); |
118 | int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay); | ||
116 | int (*set_voltage_time_sel) (struct regulator_dev *, | 119 | int (*set_voltage_time_sel) (struct regulator_dev *, |
117 | unsigned int old_selector, | 120 | unsigned int old_selector, |
118 | unsigned int new_selector); | 121 | unsigned int new_selector); |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index b02108446be7..5f37ad3cc172 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -92,6 +92,7 @@ struct regulator_state { | |||
92 | * mode. | 92 | * mode. |
93 | * @initial_state: Suspend state to set by default. | 93 | * @initial_state: Suspend state to set by default. |
94 | * @initial_mode: Mode to set at startup. | 94 | * @initial_mode: Mode to set at startup. |
95 | * @ramp_delay: Time to settle down after voltage change (unit: mV/us) | ||
95 | */ | 96 | */ |
96 | struct regulation_constraints { | 97 | struct regulation_constraints { |
97 | 98 | ||
@@ -125,6 +126,8 @@ struct regulation_constraints { | |||
125 | /* mode to set on startup */ | 126 | /* mode to set on startup */ |
126 | unsigned int initial_mode; | 127 | unsigned int initial_mode; |
127 | 128 | ||
129 | unsigned int ramp_delay; | ||
130 | |||
128 | /* constraint flags */ | 131 | /* constraint flags */ |
129 | unsigned always_on:1; /* regulator never off when system is on */ | 132 | unsigned always_on:1; /* regulator never off when system is on */ |
130 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 133 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |