diff options
Diffstat (limited to 'include/linux/regulator')
| -rw-r--r-- | include/linux/regulator/consumer.h | 79 | ||||
| -rw-r--r-- | include/linux/regulator/driver.h | 20 | ||||
| -rw-r--r-- | include/linux/regulator/machine.h | 7 |
3 files changed, 99 insertions, 7 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 27be915caa96..e530681bea70 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -146,6 +146,32 @@ struct regulator *__must_check devm_regulator_get_optional(struct device *dev, | |||
| 146 | void regulator_put(struct regulator *regulator); | 146 | void regulator_put(struct regulator *regulator); |
| 147 | void devm_regulator_put(struct regulator *regulator); | 147 | void devm_regulator_put(struct regulator *regulator); |
| 148 | 148 | ||
| 149 | int regulator_register_supply_alias(struct device *dev, const char *id, | ||
| 150 | struct device *alias_dev, | ||
| 151 | const char *alias_id); | ||
| 152 | void regulator_unregister_supply_alias(struct device *dev, const char *id); | ||
| 153 | |||
| 154 | int regulator_bulk_register_supply_alias(struct device *dev, const char **id, | ||
| 155 | struct device *alias_dev, | ||
| 156 | const char **alias_id, int num_id); | ||
| 157 | void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 158 | const char **id, int num_id); | ||
| 159 | |||
| 160 | int devm_regulator_register_supply_alias(struct device *dev, const char *id, | ||
| 161 | struct device *alias_dev, | ||
| 162 | const char *alias_id); | ||
| 163 | void devm_regulator_unregister_supply_alias(struct device *dev, | ||
| 164 | const char *id); | ||
| 165 | |||
| 166 | int devm_regulator_bulk_register_supply_alias(struct device *dev, | ||
| 167 | const char **id, | ||
| 168 | struct device *alias_dev, | ||
| 169 | const char **alias_id, | ||
| 170 | int num_id); | ||
| 171 | void devm_regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 172 | const char **id, | ||
| 173 | int num_id); | ||
| 174 | |||
| 149 | /* regulator output control and status */ | 175 | /* regulator output control and status */ |
| 150 | int __must_check regulator_enable(struct regulator *regulator); | 176 | int __must_check regulator_enable(struct regulator *regulator); |
| 151 | int regulator_disable(struct regulator *regulator); | 177 | int regulator_disable(struct regulator *regulator); |
| @@ -250,6 +276,59 @@ static inline void devm_regulator_put(struct regulator *regulator) | |||
| 250 | { | 276 | { |
| 251 | } | 277 | } |
| 252 | 278 | ||
| 279 | static inline int regulator_register_supply_alias(struct device *dev, | ||
| 280 | const char *id, | ||
| 281 | struct device *alias_dev, | ||
| 282 | const char *alias_id) | ||
| 283 | { | ||
| 284 | return 0; | ||
| 285 | } | ||
| 286 | |||
| 287 | static inline void regulator_unregister_supply_alias(struct device *dev, | ||
| 288 | const char *id) | ||
| 289 | { | ||
| 290 | } | ||
| 291 | |||
| 292 | static inline int regulator_bulk_register_supply_alias(struct device *dev, | ||
| 293 | const char **id, | ||
| 294 | struct device *alias_dev, | ||
| 295 | const char **alias_id, | ||
| 296 | int num_id) | ||
| 297 | { | ||
| 298 | return 0; | ||
| 299 | } | ||
| 300 | |||
| 301 | static inline void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 302 | const char **id, | ||
| 303 | int num_id) | ||
| 304 | { | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int devm_regulator_register_supply_alias(struct device *dev, | ||
| 308 | const char *id, | ||
| 309 | struct device *alias_dev, | ||
| 310 | const char *alias_id) | ||
| 311 | { | ||
| 312 | return 0; | ||
| 313 | } | ||
| 314 | |||
| 315 | static inline void devm_regulator_unregister_supply_alias(struct device *dev, | ||
| 316 | const char *id) | ||
| 317 | { | ||
| 318 | } | ||
| 319 | |||
| 320 | static inline int devm_regulator_bulk_register_supply_alias( | ||
| 321 | struct device *dev, const char **id, struct device *alias_dev, | ||
| 322 | const char **alias_id, int num_id) | ||
| 323 | { | ||
| 324 | return 0; | ||
| 325 | } | ||
| 326 | |||
| 327 | static inline void devm_regulator_bulk_unregister_supply_alias( | ||
| 328 | struct device *dev, const char **id, int num_id) | ||
| 329 | { | ||
| 330 | } | ||
| 331 | |||
| 253 | static inline int regulator_enable(struct regulator *regulator) | 332 | static inline int regulator_enable(struct regulator *regulator) |
| 254 | { | 333 | { |
| 255 | return 0; | 334 | return 0; |
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 | */ |
| 52 | struct regulator_linear_range { | 53 | struct 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 { | |||
| 334 | struct regulator_dev * | 345 | struct regulator_dev * |
| 335 | regulator_register(const struct regulator_desc *regulator_desc, | 346 | regulator_register(const struct regulator_desc *regulator_desc, |
| 336 | const struct regulator_config *config); | 347 | const struct regulator_config *config); |
| 348 | struct regulator_dev * | ||
| 349 | devm_regulator_register(struct device *dev, | ||
| 350 | const struct regulator_desc *regulator_desc, | ||
| 351 | const struct regulator_config *config); | ||
| 337 | void regulator_unregister(struct regulator_dev *rdev); | 352 | void regulator_unregister(struct regulator_dev *rdev); |
| 353 | void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev); | ||
| 338 | 354 | ||
| 339 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 355 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
| 340 | unsigned long event, void *data); | 356 | unsigned long event, void *data); |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 999b20ce06cf..730e638c5589 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -95,6 +95,7 @@ struct regulator_state { | |||
| 95 | * @initial_state: Suspend state to set by default. | 95 | * @initial_state: Suspend state to set by default. |
| 96 | * @initial_mode: Mode to set at startup. | 96 | * @initial_mode: Mode to set at startup. |
| 97 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) | 97 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) |
| 98 | * @enable_time: Turn-on time of the rails (unit: microseconds) | ||
| 98 | */ | 99 | */ |
| 99 | struct regulation_constraints { | 100 | struct regulation_constraints { |
| 100 | 101 | ||
| @@ -129,6 +130,7 @@ struct regulation_constraints { | |||
| 129 | unsigned int initial_mode; | 130 | unsigned int initial_mode; |
| 130 | 131 | ||
| 131 | unsigned int ramp_delay; | 132 | unsigned int ramp_delay; |
| 133 | unsigned int enable_time; | ||
| 132 | 134 | ||
| 133 | /* constraint flags */ | 135 | /* constraint flags */ |
| 134 | unsigned always_on:1; /* regulator never off when system is on */ | 136 | unsigned always_on:1; /* regulator never off when system is on */ |
| @@ -193,15 +195,10 @@ int regulator_suspend_finish(void); | |||
| 193 | 195 | ||
| 194 | #ifdef CONFIG_REGULATOR | 196 | #ifdef CONFIG_REGULATOR |
| 195 | void regulator_has_full_constraints(void); | 197 | void regulator_has_full_constraints(void); |
| 196 | void regulator_use_dummy_regulator(void); | ||
| 197 | #else | 198 | #else |
| 198 | static inline void regulator_has_full_constraints(void) | 199 | static inline void regulator_has_full_constraints(void) |
| 199 | { | 200 | { |
| 200 | } | 201 | } |
| 201 | |||
| 202 | static inline void regulator_use_dummy_regulator(void) | ||
| 203 | { | ||
| 204 | } | ||
| 205 | #endif | 202 | #endif |
| 206 | 203 | ||
| 207 | #endif | 204 | #endif |
