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.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 67e13aa5a478..9370e65348a4 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -40,23 +40,32 @@ enum regulator_status {
40}; 40};
41 41
42/** 42/**
43 * struct regulator_linear_range - specify linear voltage ranges
44 *
43 * Specify a range of voltages for regulator_map_linar_range() and 45 * Specify a range of voltages for regulator_map_linar_range() and
44 * regulator_list_linear_range(). 46 * regulator_list_linear_range().
45 * 47 *
46 * @min_uV: Lowest voltage in range 48 * @min_uV: Lowest voltage in range
47 * @max_uV: Highest voltage in range
48 * @min_sel: Lowest selector for range 49 * @min_sel: Lowest selector for range
49 * @max_sel: Highest selector for range 50 * @max_sel: Highest selector for range
50 * @uV_step: Step size 51 * @uV_step: Step size
51 */ 52 */
52struct regulator_linear_range { 53struct regulator_linear_range {
53 unsigned int min_uV; 54 unsigned int min_uV;
54 unsigned int max_uV;
55 unsigned int min_sel; 55 unsigned int min_sel;
56 unsigned int max_sel; 56 unsigned int max_sel;
57 unsigned int uV_step; 57 unsigned int uV_step;
58}; 58};
59 59
60/* Initialize struct regulator_linear_range */
61#define REGULATOR_LINEAR_RANGE(_min_uV, _min_sel, _max_sel, _step_uV) \
62{ \
63 .min_uV = _min_uV, \
64 .min_sel = _min_sel, \
65 .max_sel = _max_sel, \
66 .uV_step = _step_uV, \
67}
68
60/** 69/**
61 * struct regulator_ops - regulator operations. 70 * struct regulator_ops - regulator operations.
62 * 71 *
@@ -207,6 +216,7 @@ enum regulator_type {
207 * @min_uV: Voltage given by the lowest selector (if linear mapping) 216 * @min_uV: Voltage given by the lowest selector (if linear mapping)
208 * @uV_step: Voltage increase with each selector (if linear mapping) 217 * @uV_step: Voltage increase with each selector (if linear mapping)
209 * @linear_min_sel: Minimal selector for starting linear mapping 218 * @linear_min_sel: Minimal selector for starting linear mapping
219 * @fixed_uV: Fixed voltage of rails.
210 * @ramp_delay: Time to settle down after voltage change (unit: uV/us) 220 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
211 * @volt_table: Voltage mapping table (if table based mapping) 221 * @volt_table: Voltage mapping table (if table based mapping)
212 * 222 *
@@ -239,6 +249,7 @@ struct regulator_desc {
239 unsigned int min_uV; 249 unsigned int min_uV;
240 unsigned int uV_step; 250 unsigned int uV_step;
241 unsigned int linear_min_sel; 251 unsigned int linear_min_sel;
252 int fixed_uV;
242 unsigned int ramp_delay; 253 unsigned int ramp_delay;
243 254
244 const struct regulator_linear_range *linear_ranges; 255 const struct regulator_linear_range *linear_ranges;
@@ -334,7 +345,12 @@ struct regulator_dev {
334struct regulator_dev * 345struct regulator_dev *
335regulator_register(const struct regulator_desc *regulator_desc, 346regulator_register(const struct regulator_desc *regulator_desc,
336 const struct regulator_config *config); 347 const struct regulator_config *config);
348struct regulator_dev *
349devm_regulator_register(struct device *dev,
350 const struct regulator_desc *regulator_desc,
351 const struct regulator_config *config);
337void regulator_unregister(struct regulator_dev *rdev); 352void regulator_unregister(struct regulator_dev *rdev);
353void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev);
338 354
339int regulator_notifier_call_chain(struct regulator_dev *rdev, 355int regulator_notifier_call_chain(struct regulator_dev *rdev,
340 unsigned long event, void *data); 356 unsigned long event, void *data);