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.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 592cd7c642c2..6c433b89c80d 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -42,7 +42,11 @@ enum regulator_status {
42 * 42 *
43 * @set_voltage: Set the voltage for the regulator within the range specified. 43 * @set_voltage: Set the voltage for the regulator within the range specified.
44 * The driver should select the voltage closest to min_uV. 44 * The driver should select the voltage closest to min_uV.
45 * @set_voltage_sel: Set the voltage for the regulator using the specified
46 * selector.
45 * @get_voltage: Return the currently configured voltage for the regulator. 47 * @get_voltage: Return the currently configured voltage for the regulator.
48 * @get_voltage_sel: Return the currently configured voltage selector for the
49 * regulator.
46 * @list_voltage: Return one of the supported voltages, in microvolts; zero 50 * @list_voltage: Return one of the supported voltages, in microvolts; zero
47 * if the selector indicates a voltage that is unusable on this system; 51 * if the selector indicates a voltage that is unusable on this system;
48 * or negative errno. Selectors range from zero to one less than 52 * or negative errno. Selectors range from zero to one less than
@@ -59,7 +63,11 @@ enum regulator_status {
59 * when running with the specified parameters. 63 * when running with the specified parameters.
60 * 64 *
61 * @enable_time: Time taken for the regulator voltage output voltage to 65 * @enable_time: Time taken for the regulator voltage output voltage to
62 * stabalise after being enabled, in microseconds. 66 * stabilise after being enabled, in microseconds.
67 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage
68 * to stabilise after being set to a new value, in microseconds.
69 * The function provides the from and to voltage selector, the
70 * function should return the worst case.
63 * 71 *
64 * @set_suspend_voltage: Set the voltage for the regulator when the system 72 * @set_suspend_voltage: Set the voltage for the regulator when the system
65 * is suspended. 73 * is suspended.
@@ -79,8 +87,11 @@ struct regulator_ops {
79 int (*list_voltage) (struct regulator_dev *, unsigned selector); 87 int (*list_voltage) (struct regulator_dev *, unsigned selector);
80 88
81 /* get/set regulator voltage */ 89 /* get/set regulator voltage */
82 int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); 90 int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV,
91 unsigned *selector);
92 int (*set_voltage_sel) (struct regulator_dev *, unsigned selector);
83 int (*get_voltage) (struct regulator_dev *); 93 int (*get_voltage) (struct regulator_dev *);
94 int (*get_voltage_sel) (struct regulator_dev *);
84 95
85 /* get/set regulator current */ 96 /* get/set regulator current */
86 int (*set_current_limit) (struct regulator_dev *, 97 int (*set_current_limit) (struct regulator_dev *,
@@ -96,8 +107,11 @@ struct regulator_ops {
96 int (*set_mode) (struct regulator_dev *, unsigned int mode); 107 int (*set_mode) (struct regulator_dev *, unsigned int mode);
97 unsigned int (*get_mode) (struct regulator_dev *); 108 unsigned int (*get_mode) (struct regulator_dev *);
98 109
99 /* Time taken to enable the regulator */ 110 /* Time taken to enable or set voltage on the regulator */
100 int (*enable_time) (struct regulator_dev *); 111 int (*enable_time) (struct regulator_dev *);
112 int (*set_voltage_time_sel) (struct regulator_dev *,
113 unsigned int old_selector,
114 unsigned int new_selector);
101 115
102 /* report regulator status ... most other accessors report 116 /* report regulator status ... most other accessors report
103 * control inputs, this reports results of combining inputs 117 * control inputs, this reports results of combining inputs
@@ -168,9 +182,9 @@ struct regulator_desc {
168 */ 182 */
169struct regulator_dev { 183struct regulator_dev {
170 struct regulator_desc *desc; 184 struct regulator_desc *desc;
171 int use_count;
172 int open_count;
173 int exclusive; 185 int exclusive;
186 u32 use_count;
187 u32 open_count;
174 188
175 /* lists we belong to */ 189 /* lists we belong to */
176 struct list_head list; /* list of all regulators */ 190 struct list_head list; /* list of all regulators */
@@ -188,10 +202,14 @@ struct regulator_dev {
188 struct regulator_dev *supply; /* for tree */ 202 struct regulator_dev *supply; /* for tree */
189 203
190 void *reg_data; /* regulator_dev data */ 204 void *reg_data; /* regulator_dev data */
205
206#ifdef CONFIG_DEBUG_FS
207 struct dentry *debugfs;
208#endif
191}; 209};
192 210
193struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, 211struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
194 struct device *dev, struct regulator_init_data *init_data, 212 struct device *dev, const struct regulator_init_data *init_data,
195 void *driver_data); 213 void *driver_data);
196void regulator_unregister(struct regulator_dev *rdev); 214void regulator_unregister(struct regulator_dev *rdev);
197 215