aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator/driver.h
diff options
context:
space:
mode:
authorCarlo Caione <carlo@caione.org>2014-03-05 16:11:29 -0500
committerMark Brown <broonie@linaro.org>2014-03-06 04:30:10 -0500
commitca5d1b3524b4d90a2e2f1f71583c1dca6b96fd92 (patch)
treeacf10cbf9247ec8d7f8437faa9ba154a1fb8665e /include/linux/regulator/driver.h
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
regulator: helpers: Modify helpers enabling multi-bit control
This patch extends the regulator helpers to account for device that use multiple bits for control when using regmap enable/disable/bypass ops. The actual regulator helpers wrongly assume that the regulator control is always performed using single bits, using in the regulator_desc struct only two parameters *_reg and *_mask defining register and mask for control. This patch extends this struct and introduces the helpers to take into account devices where control is performed using multiple bits and specific multi-bit values are used for enabling/disabling/bypassing the regulator. Signed-off-by: Carlo Caione <carlo@caione.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/regulator/driver.h')
-rw-r--r--include/linux/regulator/driver.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 9370e65348a4..bbe03a1924c0 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -228,10 +228,14 @@ enum regulator_type {
228 * output when using regulator_set_voltage_sel_regmap 228 * output when using regulator_set_voltage_sel_regmap
229 * @enable_reg: Register for control when using regmap enable/disable ops 229 * @enable_reg: Register for control when using regmap enable/disable ops
230 * @enable_mask: Mask for control when using regmap enable/disable ops 230 * @enable_mask: Mask for control when using regmap enable/disable ops
231 * @enable_val: Enabling value for control when using regmap enable/disable ops
232 * @disable_val: Disabling value for control when using regmap enable/disable ops
231 * @enable_is_inverted: A flag to indicate set enable_mask bits to disable 233 * @enable_is_inverted: A flag to indicate set enable_mask bits to disable
232 * when using regulator_enable_regmap and friends APIs. 234 * when using regulator_enable_regmap and friends APIs.
233 * @bypass_reg: Register for control when using regmap set_bypass 235 * @bypass_reg: Register for control when using regmap set_bypass
234 * @bypass_mask: Mask for control when using regmap set_bypass 236 * @bypass_mask: Mask for control when using regmap set_bypass
237 * @bypass_val_on: Enabling value for control when using regmap set_bypass
238 * @bypass_val_off: Disabling value for control when using regmap set_bypass
235 * 239 *
236 * @enable_time: Time taken for initial enable of regulator (in uS). 240 * @enable_time: Time taken for initial enable of regulator (in uS).
237 */ 241 */
@@ -263,9 +267,13 @@ struct regulator_desc {
263 unsigned int apply_bit; 267 unsigned int apply_bit;
264 unsigned int enable_reg; 268 unsigned int enable_reg;
265 unsigned int enable_mask; 269 unsigned int enable_mask;
270 unsigned int enable_val;
271 unsigned int disable_val;
266 bool enable_is_inverted; 272 bool enable_is_inverted;
267 unsigned int bypass_reg; 273 unsigned int bypass_reg;
268 unsigned int bypass_mask; 274 unsigned int bypass_mask;
275 unsigned int bypass_val_on;
276 unsigned int bypass_val_off;
269 277
270 unsigned int enable_time; 278 unsigned int enable_time;
271}; 279};