aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator/driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/regulator/driver.h')
-rw-r--r--include/linux/regulator/driver.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index bac4c871f3bd..7932a3bf21bd 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -32,6 +32,8 @@ enum regulator_status {
32 REGULATOR_STATUS_NORMAL, 32 REGULATOR_STATUS_NORMAL,
33 REGULATOR_STATUS_IDLE, 33 REGULATOR_STATUS_IDLE,
34 REGULATOR_STATUS_STANDBY, 34 REGULATOR_STATUS_STANDBY,
35 /* The regulator is enabled but not regulating */
36 REGULATOR_STATUS_BYPASS,
35 /* in case that any other status doesn't apply */ 37 /* in case that any other status doesn't apply */
36 REGULATOR_STATUS_UNDEFINED, 38 REGULATOR_STATUS_UNDEFINED,
37}; 39};
@@ -58,6 +60,7 @@ enum regulator_status {
58 * regulator_desc.n_voltages. Voltages may be reported in any order. 60 * regulator_desc.n_voltages. Voltages may be reported in any order.
59 * 61 *
60 * @set_current_limit: Configure a limit for a current-limited regulator. 62 * @set_current_limit: Configure a limit for a current-limited regulator.
63 * The driver should select the current closest to max_uA.
61 * @get_current_limit: Get the configured limit for a current-limited regulator. 64 * @get_current_limit: Get the configured limit for a current-limited regulator.
62 * 65 *
63 * @set_mode: Set the configured operating mode for the regulator. 66 * @set_mode: Set the configured operating mode for the regulator.
@@ -67,6 +70,9 @@ enum regulator_status {
67 * @get_optimum_mode: Get the most efficient operating mode for the regulator 70 * @get_optimum_mode: Get the most efficient operating mode for the regulator
68 * when running with the specified parameters. 71 * when running with the specified parameters.
69 * 72 *
73 * @set_bypass: Set the regulator in bypass mode.
74 * @get_bypass: Get the regulator bypass mode state.
75 *
70 * @enable_time: Time taken for the regulator voltage output voltage to 76 * @enable_time: Time taken for the regulator voltage output voltage to
71 * stabilise after being enabled, in microseconds. 77 * stabilise after being enabled, in microseconds.
72 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should 78 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
@@ -133,6 +139,10 @@ struct regulator_ops {
133 unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, 139 unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV,
134 int output_uV, int load_uA); 140 int output_uV, int load_uA);
135 141
142 /* control and report on bypass mode */
143 int (*set_bypass)(struct regulator_dev *dev, bool enable);
144 int (*get_bypass)(struct regulator_dev *dev, bool *enable);
145
136 /* the operations below are for configuration of regulator state when 146 /* the operations below are for configuration of regulator state when
137 * its parent PMIC enters a global STANDBY/HIBERNATE state */ 147 * its parent PMIC enters a global STANDBY/HIBERNATE state */
138 148
@@ -205,6 +215,8 @@ struct regulator_desc {
205 unsigned int vsel_mask; 215 unsigned int vsel_mask;
206 unsigned int enable_reg; 216 unsigned int enable_reg;
207 unsigned int enable_mask; 217 unsigned int enable_mask;
218 unsigned int bypass_reg;
219 unsigned int bypass_mask;
208 220
209 unsigned int enable_time; 221 unsigned int enable_time;
210}; 222};
@@ -221,7 +233,8 @@ struct regulator_desc {
221 * @driver_data: private regulator data 233 * @driver_data: private regulator data
222 * @of_node: OpenFirmware node to parse for device tree bindings (may be 234 * @of_node: OpenFirmware node to parse for device tree bindings (may be
223 * NULL). 235 * NULL).
224 * @regmap: regmap to use for core regmap helpers 236 * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is
237 * insufficient.
225 * @ena_gpio: GPIO controlling regulator enable. 238 * @ena_gpio: GPIO controlling regulator enable.
226 * @ena_gpio_invert: Sense for GPIO enable control. 239 * @ena_gpio_invert: Sense for GPIO enable control.
227 * @ena_gpio_flags: Flags to use when calling gpio_request_one() 240 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
@@ -253,6 +266,7 @@ struct regulator_dev {
253 int exclusive; 266 int exclusive;
254 u32 use_count; 267 u32 use_count;
255 u32 open_count; 268 u32 open_count;
269 u32 bypass_count;
256 270
257 /* lists we belong to */ 271 /* lists we belong to */
258 struct list_head list; /* list of all regulators */ 272 struct list_head list; /* list of all regulators */
@@ -310,6 +324,8 @@ int regulator_disable_regmap(struct regulator_dev *rdev);
310int regulator_set_voltage_time_sel(struct regulator_dev *rdev, 324int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
311 unsigned int old_selector, 325 unsigned int old_selector,
312 unsigned int new_selector); 326 unsigned int new_selector);
327int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable);
328int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable);
313 329
314void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); 330void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
315 331