diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
| commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
| tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/regulator | |
| parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) | |
Patched in Tegra support.
Diffstat (limited to 'include/linux/regulator')
| -rw-r--r-- | include/linux/regulator/ab8500.h | 70 | ||||
| -rw-r--r-- | include/linux/regulator/consumer.h | 101 | ||||
| -rw-r--r-- | include/linux/regulator/driver.h | 136 | ||||
| -rw-r--r-- | include/linux/regulator/fan53555.h | 60 | ||||
| -rw-r--r-- | include/linux/regulator/fixed.h | 25 | ||||
| -rw-r--r-- | include/linux/regulator/lp872x.h | 90 | ||||
| -rw-r--r-- | include/linux/regulator/machine.h | 17 | ||||
| -rw-r--r-- | include/linux/regulator/max8973-regulator.h | 72 | ||||
| -rw-r--r-- | include/linux/regulator/of_regulator.h | 40 | ||||
| -rw-r--r-- | include/linux/regulator/tps51632-regulator.h | 47 | ||||
| -rw-r--r-- | include/linux/regulator/tps62360.h | 6 |
11 files changed, 62 insertions, 602 deletions
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 7bd73bbdfd1..76579f964a2 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
| @@ -26,26 +26,7 @@ enum ab8500_regulator_id { | |||
| 26 | AB8500_NUM_REGULATORS, | 26 | AB8500_NUM_REGULATORS, |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | /* AB9450 regulators */ | 29 | /* AB8500 register initialization */ |
| 30 | enum ab9540_regulator_id { | ||
| 31 | AB9540_LDO_AUX1, | ||
| 32 | AB9540_LDO_AUX2, | ||
| 33 | AB9540_LDO_AUX3, | ||
| 34 | AB9540_LDO_AUX4, | ||
| 35 | AB9540_LDO_INTCORE, | ||
| 36 | AB9540_LDO_TVOUT, | ||
| 37 | AB9540_LDO_USB, | ||
| 38 | AB9540_LDO_AUDIO, | ||
| 39 | AB9540_LDO_ANAMIC1, | ||
| 40 | AB9540_LDO_ANAMIC2, | ||
| 41 | AB9540_LDO_DMIC, | ||
| 42 | AB9540_LDO_ANA, | ||
| 43 | AB9540_SYSCLKREQ_2, | ||
| 44 | AB9540_SYSCLKREQ_4, | ||
| 45 | AB9540_NUM_REGULATORS, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* AB8500 and AB9540 register initialization */ | ||
| 49 | struct ab8500_regulator_reg_init { | 30 | struct ab8500_regulator_reg_init { |
| 50 | int id; | 31 | int id; |
| 51 | u8 value; | 32 | u8 value; |
| @@ -90,53 +71,4 @@ enum ab8500_regulator_reg { | |||
| 90 | AB8500_NUM_REGULATOR_REGISTERS, | 71 | AB8500_NUM_REGULATOR_REGISTERS, |
| 91 | }; | 72 | }; |
| 92 | 73 | ||
| 93 | |||
| 94 | /* AB9540 registers */ | ||
| 95 | enum ab9540_regulator_reg { | ||
| 96 | AB9540_REGUREQUESTCTRL1, | ||
| 97 | AB9540_REGUREQUESTCTRL2, | ||
| 98 | AB9540_REGUREQUESTCTRL3, | ||
| 99 | AB9540_REGUREQUESTCTRL4, | ||
| 100 | AB9540_REGUSYSCLKREQ1HPVALID1, | ||
| 101 | AB9540_REGUSYSCLKREQ1HPVALID2, | ||
| 102 | AB9540_REGUHWHPREQ1VALID1, | ||
| 103 | AB9540_REGUHWHPREQ1VALID2, | ||
| 104 | AB9540_REGUHWHPREQ2VALID1, | ||
| 105 | AB9540_REGUHWHPREQ2VALID2, | ||
| 106 | AB9540_REGUSWHPREQVALID1, | ||
| 107 | AB9540_REGUSWHPREQVALID2, | ||
| 108 | AB9540_REGUSYSCLKREQVALID1, | ||
| 109 | AB9540_REGUSYSCLKREQVALID2, | ||
| 110 | AB9540_REGUVAUX4REQVALID, | ||
| 111 | AB9540_REGUMISC1, | ||
| 112 | AB9540_VAUDIOSUPPLY, | ||
| 113 | AB9540_REGUCTRL1VAMIC, | ||
| 114 | AB9540_VSMPS1REGU, | ||
| 115 | AB9540_VSMPS2REGU, | ||
| 116 | AB9540_VSMPS3REGU, /* NOTE! PRCMU register */ | ||
| 117 | AB9540_VPLLVANAREGU, | ||
| 118 | AB9540_EXTSUPPLYREGU, | ||
| 119 | AB9540_VAUX12REGU, | ||
| 120 | AB9540_VRF1VAUX3REGU, | ||
| 121 | AB9540_VSMPS1SEL1, | ||
| 122 | AB9540_VSMPS1SEL2, | ||
| 123 | AB9540_VSMPS1SEL3, | ||
| 124 | AB9540_VSMPS2SEL1, | ||
| 125 | AB9540_VSMPS2SEL2, | ||
| 126 | AB9540_VSMPS2SEL3, | ||
| 127 | AB9540_VSMPS3SEL1, /* NOTE! PRCMU register */ | ||
| 128 | AB9540_VSMPS3SEL2, /* NOTE! PRCMU register */ | ||
| 129 | AB9540_VAUX1SEL, | ||
| 130 | AB9540_VAUX2SEL, | ||
| 131 | AB9540_VRF1VAUX3SEL, | ||
| 132 | AB9540_REGUCTRL2SPARE, | ||
| 133 | AB9540_VAUX4REQCTRL, | ||
| 134 | AB9540_VAUX4REGU, | ||
| 135 | AB9540_VAUX4SEL, | ||
| 136 | AB9540_REGUCTRLDISCH, | ||
| 137 | AB9540_REGUCTRLDISCH2, | ||
| 138 | AB9540_REGUCTRLDISCH3, | ||
| 139 | AB9540_NUM_REGULATOR_REGISTERS, | ||
| 140 | }; | ||
| 141 | |||
| 142 | #endif | 74 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 7bc732ce6e5..8699df6fbb7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * consumer.h -- SoC Regulator consumer support. | 2 | * consumer.h -- SoC Regulator consumer support. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. | 4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. |
| 5 | * Copyright (C) 2012 NVIDIA Corporation | ||
| 5 | * | 6 | * |
| 6 | * Author: Liam Girdwood <lrg@slimlogic.co.uk> | 7 | * Author: Liam Girdwood <lrg@slimlogic.co.uk> |
| 7 | * | 8 | * |
| @@ -35,8 +36,7 @@ | |||
| 35 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ | 36 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ |
| 36 | #define __LINUX_REGULATOR_CONSUMER_H_ | 37 | #define __LINUX_REGULATOR_CONSUMER_H_ |
| 37 | 38 | ||
| 38 | struct device; | 39 | #include <linux/device.h> |
| 39 | struct notifier_block; | ||
| 40 | 40 | ||
| 41 | /* | 41 | /* |
| 42 | * Regulator operating modes. | 42 | * Regulator operating modes. |
| @@ -93,6 +93,10 @@ struct notifier_block; | |||
| 93 | * FORCE_DISABLE Regulator forcibly shut down by software. | 93 | * FORCE_DISABLE Regulator forcibly shut down by software. |
| 94 | * VOLTAGE_CHANGE Regulator voltage changed. | 94 | * VOLTAGE_CHANGE Regulator voltage changed. |
| 95 | * DISABLE Regulator was disabled. | 95 | * DISABLE Regulator was disabled. |
| 96 | * PRE_ENABLE Regulator is to be enabled | ||
| 97 | * POST_ENABLE Regulator was enabled | ||
| 98 | * OUT_PRECHANGE Regulator is enabled and its voltage is to be changed | ||
| 99 | * OUT_POSTCHANGE Regulator is enabled and its voltage was changed | ||
| 96 | * | 100 | * |
| 97 | * NOTE: These events can be OR'ed together when passed into handler. | 101 | * NOTE: These events can be OR'ed together when passed into handler. |
| 98 | */ | 102 | */ |
| @@ -105,6 +109,10 @@ struct notifier_block; | |||
| 105 | #define REGULATOR_EVENT_FORCE_DISABLE 0x20 | 109 | #define REGULATOR_EVENT_FORCE_DISABLE 0x20 |
| 106 | #define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40 | 110 | #define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40 |
| 107 | #define REGULATOR_EVENT_DISABLE 0x80 | 111 | #define REGULATOR_EVENT_DISABLE 0x80 |
| 112 | #define REGULATOR_EVENT_PRE_ENABLE 0x100 | ||
| 113 | #define REGULATOR_EVENT_POST_ENABLE 0x200 | ||
| 114 | #define REGULATOR_EVENT_OUT_PRECHANGE 0x400 | ||
| 115 | #define REGULATOR_EVENT_OUT_POSTCHANGE 0x800 | ||
| 108 | 116 | ||
| 109 | struct regulator; | 117 | struct regulator; |
| 110 | 118 | ||
| @@ -133,34 +141,25 @@ struct regulator_bulk_data { | |||
| 133 | /* regulator get and put */ | 141 | /* regulator get and put */ |
| 134 | struct regulator *__must_check regulator_get(struct device *dev, | 142 | struct regulator *__must_check regulator_get(struct device *dev, |
| 135 | const char *id); | 143 | const char *id); |
| 136 | struct regulator *__must_check devm_regulator_get(struct device *dev, | ||
| 137 | const char *id); | ||
| 138 | struct regulator *__must_check regulator_get_exclusive(struct device *dev, | 144 | struct regulator *__must_check regulator_get_exclusive(struct device *dev, |
| 139 | const char *id); | 145 | const char *id); |
| 140 | void regulator_put(struct regulator *regulator); | 146 | void regulator_put(struct regulator *regulator); |
| 141 | void devm_regulator_put(struct regulator *regulator); | ||
| 142 | 147 | ||
| 143 | /* regulator output control and status */ | 148 | /* regulator output control and status */ |
| 144 | int regulator_enable(struct regulator *regulator); | 149 | int regulator_enable(struct regulator *regulator); |
| 145 | int regulator_disable(struct regulator *regulator); | 150 | int regulator_disable(struct regulator *regulator); |
| 146 | int regulator_force_disable(struct regulator *regulator); | 151 | int regulator_force_disable(struct regulator *regulator); |
| 147 | int regulator_is_enabled(struct regulator *regulator); | 152 | int regulator_is_enabled(struct regulator *regulator); |
| 148 | int regulator_disable_deferred(struct regulator *regulator, int ms); | ||
| 149 | 153 | ||
| 150 | int regulator_bulk_get(struct device *dev, int num_consumers, | 154 | int regulator_bulk_get(struct device *dev, int num_consumers, |
| 151 | struct regulator_bulk_data *consumers); | 155 | struct regulator_bulk_data *consumers); |
| 152 | int devm_regulator_bulk_get(struct device *dev, int num_consumers, | ||
| 153 | struct regulator_bulk_data *consumers); | ||
| 154 | int regulator_bulk_enable(int num_consumers, | 156 | int regulator_bulk_enable(int num_consumers, |
| 155 | struct regulator_bulk_data *consumers); | 157 | struct regulator_bulk_data *consumers); |
| 156 | int regulator_bulk_disable(int num_consumers, | 158 | int regulator_bulk_disable(int num_consumers, |
| 157 | struct regulator_bulk_data *consumers); | 159 | struct regulator_bulk_data *consumers); |
| 158 | int regulator_bulk_force_disable(int num_consumers, | ||
| 159 | struct regulator_bulk_data *consumers); | ||
| 160 | void regulator_bulk_free(int num_consumers, | 160 | void regulator_bulk_free(int num_consumers, |
| 161 | struct regulator_bulk_data *consumers); | 161 | struct regulator_bulk_data *consumers); |
| 162 | 162 | ||
| 163 | int regulator_can_change_voltage(struct regulator *regulator); | ||
| 164 | int regulator_count_voltages(struct regulator *regulator); | 163 | int regulator_count_voltages(struct regulator *regulator); |
| 165 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 164 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
| 166 | int regulator_is_supported_voltage(struct regulator *regulator, | 165 | int regulator_is_supported_voltage(struct regulator *regulator, |
| @@ -178,8 +177,6 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode); | |||
| 178 | unsigned int regulator_get_mode(struct regulator *regulator); | 177 | unsigned int regulator_get_mode(struct regulator *regulator); |
| 179 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | 178 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); |
| 180 | 179 | ||
| 181 | int regulator_allow_bypass(struct regulator *regulator, bool allow); | ||
| 182 | |||
| 183 | /* regulator notifier block */ | 180 | /* regulator notifier block */ |
| 184 | int regulator_register_notifier(struct regulator *regulator, | 181 | int regulator_register_notifier(struct regulator *regulator, |
| 185 | struct notifier_block *nb); | 182 | struct notifier_block *nb); |
| @@ -209,21 +206,16 @@ static inline struct regulator *__must_check regulator_get(struct device *dev, | |||
| 209 | */ | 206 | */ |
| 210 | return NULL; | 207 | return NULL; |
| 211 | } | 208 | } |
| 212 | 209 | static inline struct regulator *__must_check regulator_get_exclusive( | |
| 213 | static inline struct regulator *__must_check | 210 | struct device *dev, const char *id) |
| 214 | devm_regulator_get(struct device *dev, const char *id) | ||
| 215 | { | 211 | { |
| 212 | /* See comment for regulator_get() stub, above */ | ||
| 216 | return NULL; | 213 | return NULL; |
| 217 | } | 214 | } |
| 218 | |||
| 219 | static inline void regulator_put(struct regulator *regulator) | 215 | static inline void regulator_put(struct regulator *regulator) |
| 220 | { | 216 | { |
| 221 | } | 217 | } |
| 222 | 218 | ||
| 223 | static inline void devm_regulator_put(struct regulator *regulator) | ||
| 224 | { | ||
| 225 | } | ||
| 226 | |||
| 227 | static inline int regulator_enable(struct regulator *regulator) | 219 | static inline int regulator_enable(struct regulator *regulator) |
| 228 | { | 220 | { |
| 229 | return 0; | 221 | return 0; |
| @@ -239,12 +231,6 @@ static inline int regulator_force_disable(struct regulator *regulator) | |||
| 239 | return 0; | 231 | return 0; |
| 240 | } | 232 | } |
| 241 | 233 | ||
| 242 | static inline int regulator_disable_deferred(struct regulator *regulator, | ||
| 243 | int ms) | ||
| 244 | { | ||
| 245 | return 0; | ||
| 246 | } | ||
| 247 | |||
| 248 | static inline int regulator_is_enabled(struct regulator *regulator) | 234 | static inline int regulator_is_enabled(struct regulator *regulator) |
| 249 | { | 235 | { |
| 250 | return 1; | 236 | return 1; |
| @@ -257,12 +243,6 @@ static inline int regulator_bulk_get(struct device *dev, | |||
| 257 | return 0; | 243 | return 0; |
| 258 | } | 244 | } |
| 259 | 245 | ||
| 260 | static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers, | ||
| 261 | struct regulator_bulk_data *consumers) | ||
| 262 | { | ||
| 263 | return 0; | ||
| 264 | } | ||
| 265 | |||
| 266 | static inline int regulator_bulk_enable(int num_consumers, | 246 | static inline int regulator_bulk_enable(int num_consumers, |
| 267 | struct regulator_bulk_data *consumers) | 247 | struct regulator_bulk_data *consumers) |
| 268 | { | 248 | { |
| @@ -275,15 +255,26 @@ static inline int regulator_bulk_disable(int num_consumers, | |||
| 275 | return 0; | 255 | return 0; |
| 276 | } | 256 | } |
| 277 | 257 | ||
| 278 | static inline int regulator_bulk_force_disable(int num_consumers, | 258 | static inline void regulator_bulk_free(int num_consumers, |
| 279 | struct regulator_bulk_data *consumers) | 259 | struct regulator_bulk_data *consumers) |
| 260 | { | ||
| 261 | } | ||
| 262 | |||
| 263 | static inline int regulator_count_voltages(struct regulator *regulator) | ||
| 280 | { | 264 | { |
| 281 | return 0; | 265 | return 0; |
| 282 | } | 266 | } |
| 283 | 267 | ||
| 284 | static inline void regulator_bulk_free(int num_consumers, | 268 | static inline int regulator_list_voltage(struct regulator *regulator, |
| 285 | struct regulator_bulk_data *consumers) | 269 | unsigned selector) |
| 286 | { | 270 | { |
| 271 | return 0; | ||
| 272 | } | ||
| 273 | |||
| 274 | static inline int regulator_is_supported_voltage(struct regulator *regulator, | ||
| 275 | int min_uV, int max_uV) | ||
| 276 | { | ||
| 277 | return 0; | ||
| 287 | } | 278 | } |
| 288 | 279 | ||
| 289 | static inline int regulator_set_voltage(struct regulator *regulator, | 280 | static inline int regulator_set_voltage(struct regulator *regulator, |
| @@ -292,13 +283,18 @@ static inline int regulator_set_voltage(struct regulator *regulator, | |||
| 292 | return 0; | 283 | return 0; |
| 293 | } | 284 | } |
| 294 | 285 | ||
| 286 | static inline int regulator_set_voltage_time(struct regulator *regulator, | ||
| 287 | int old_uV, int new_uV) | ||
| 288 | { | ||
| 289 | return 0; | ||
| 290 | } | ||
| 291 | |||
| 295 | static inline int regulator_get_voltage(struct regulator *regulator) | 292 | static inline int regulator_get_voltage(struct regulator *regulator) |
| 296 | { | 293 | { |
| 297 | return -EINVAL; | 294 | return 0; |
| 298 | } | 295 | } |
| 299 | 296 | ||
| 300 | static inline int regulator_is_supported_voltage(struct regulator *regulator, | 297 | static inline int regulator_sync_voltage(struct regulator *regulator) |
| 301 | int min_uV, int max_uV) | ||
| 302 | { | 298 | { |
| 303 | return 0; | 299 | return 0; |
| 304 | } | 300 | } |
| @@ -331,12 +327,6 @@ static inline int regulator_set_optimum_mode(struct regulator *regulator, | |||
| 331 | return REGULATOR_MODE_NORMAL; | 327 | return REGULATOR_MODE_NORMAL; |
| 332 | } | 328 | } |
| 333 | 329 | ||
| 334 | static inline int regulator_allow_bypass(struct regulator *regulator, | ||
| 335 | bool allow) | ||
| 336 | { | ||
| 337 | return 0; | ||
| 338 | } | ||
| 339 | |||
| 340 | static inline int regulator_register_notifier(struct regulator *regulator, | 330 | static inline int regulator_register_notifier(struct regulator *regulator, |
| 341 | struct notifier_block *nb) | 331 | struct notifier_block *nb) |
| 342 | { | 332 | { |
| @@ -359,25 +349,6 @@ static inline void regulator_set_drvdata(struct regulator *regulator, | |||
| 359 | { | 349 | { |
| 360 | } | 350 | } |
| 361 | 351 | ||
| 362 | static inline int regulator_count_voltages(struct regulator *regulator) | ||
| 363 | { | ||
| 364 | return 0; | ||
| 365 | } | ||
| 366 | #endif | 352 | #endif |
| 367 | 353 | ||
| 368 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | ||
| 369 | int new_uV, int tol_uV) | ||
| 370 | { | ||
| 371 | return regulator_set_voltage(regulator, | ||
| 372 | new_uV - tol_uV, new_uV + tol_uV); | ||
| 373 | } | ||
| 374 | |||
| 375 | static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, | ||
| 376 | int target_uV, int tol_uV) | ||
| 377 | { | ||
| 378 | return regulator_is_supported_voltage(regulator, | ||
| 379 | target_uV - tol_uV, | ||
| 380 | target_uV + tol_uV); | ||
| 381 | } | ||
| 382 | |||
| 383 | #endif | 354 | #endif |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d10bb0f39c5..1a80bc77517 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -16,10 +16,8 @@ | |||
| 16 | #define __LINUX_REGULATOR_DRIVER_H_ | 16 | #define __LINUX_REGULATOR_DRIVER_H_ |
| 17 | 17 | ||
| 18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
| 19 | #include <linux/notifier.h> | ||
| 20 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
| 21 | 20 | ||
| 22 | struct regmap; | ||
| 23 | struct regulator_dev; | 21 | struct regulator_dev; |
| 24 | struct regulator_init_data; | 22 | struct regulator_init_data; |
| 25 | 23 | ||
| @@ -32,10 +30,6 @@ enum regulator_status { | |||
| 32 | REGULATOR_STATUS_NORMAL, | 30 | REGULATOR_STATUS_NORMAL, |
| 33 | REGULATOR_STATUS_IDLE, | 31 | REGULATOR_STATUS_IDLE, |
| 34 | REGULATOR_STATUS_STANDBY, | 32 | REGULATOR_STATUS_STANDBY, |
| 35 | /* The regulator is enabled but not regulating */ | ||
| 36 | REGULATOR_STATUS_BYPASS, | ||
| 37 | /* in case that any other status doesn't apply */ | ||
| 38 | REGULATOR_STATUS_UNDEFINED, | ||
| 39 | }; | 33 | }; |
| 40 | 34 | ||
| 41 | /** | 35 | /** |
| @@ -50,7 +44,6 @@ enum regulator_status { | |||
| 50 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
| 51 | * @set_voltage_sel: Set the voltage for the regulator using the specified | 45 | * @set_voltage_sel: Set the voltage for the regulator using the specified |
| 52 | * selector. | 46 | * selector. |
| 53 | * @map_voltage: Convert a voltage into a selector | ||
| 54 | * @get_voltage: Return the currently configured voltage for the regulator. | 47 | * @get_voltage: Return the currently configured voltage for the regulator. |
| 55 | * @get_voltage_sel: Return the currently configured voltage selector for the | 48 | * @get_voltage_sel: Return the currently configured voltage selector for the |
| 56 | * regulator. | 49 | * regulator. |
| @@ -60,7 +53,6 @@ enum regulator_status { | |||
| 60 | * regulator_desc.n_voltages. Voltages may be reported in any order. | 53 | * regulator_desc.n_voltages. Voltages may be reported in any order. |
| 61 | * | 54 | * |
| 62 | * @set_current_limit: Configure a limit for a current-limited regulator. | 55 | * @set_current_limit: Configure a limit for a current-limited regulator. |
| 63 | * The driver should select the current closest to max_uA. | ||
| 64 | * @get_current_limit: Get the configured limit for a current-limited regulator. | 56 | * @get_current_limit: Get the configured limit for a current-limited regulator. |
| 65 | * | 57 | * |
| 66 | * @set_mode: Set the configured operating mode for the regulator. | 58 | * @set_mode: Set the configured operating mode for the regulator. |
| @@ -70,13 +62,8 @@ enum regulator_status { | |||
| 70 | * @get_optimum_mode: Get the most efficient operating mode for the regulator | 62 | * @get_optimum_mode: Get the most efficient operating mode for the regulator |
| 71 | * when running with the specified parameters. | 63 | * when running with the specified parameters. |
| 72 | * | 64 | * |
| 73 | * @set_bypass: Set the regulator in bypass mode. | ||
| 74 | * @get_bypass: Get the regulator bypass mode state. | ||
| 75 | * | ||
| 76 | * @enable_time: Time taken for the regulator voltage output voltage to | 65 | * @enable_time: Time taken for the regulator voltage output voltage to |
| 77 | * stabilise after being enabled, in microseconds. | 66 | * stabilise after being enabled, in microseconds. |
| 78 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should | ||
| 79 | * select ramp delay equal to or less than(closest) ramp_delay. | ||
| 80 | * @set_voltage_time_sel: Time taken for the regulator voltage output voltage | 67 | * @set_voltage_time_sel: Time taken for the regulator voltage output voltage |
| 81 | * to stabilise after being set to a new value, in microseconds. | 68 | * to stabilise after being set to a new value, in microseconds. |
| 82 | * The function provides the from and to voltage selector, the | 69 | * The function provides the from and to voltage selector, the |
| @@ -102,7 +89,6 @@ struct regulator_ops { | |||
| 102 | /* get/set regulator voltage */ | 89 | /* get/set regulator voltage */ |
| 103 | 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, |
| 104 | unsigned *selector); | 91 | unsigned *selector); |
| 105 | int (*map_voltage)(struct regulator_dev *, int min_uV, int max_uV); | ||
| 106 | int (*set_voltage_sel) (struct regulator_dev *, unsigned selector); | 92 | int (*set_voltage_sel) (struct regulator_dev *, unsigned selector); |
| 107 | int (*get_voltage) (struct regulator_dev *); | 93 | int (*get_voltage) (struct regulator_dev *); |
| 108 | int (*get_voltage_sel) (struct regulator_dev *); | 94 | int (*get_voltage_sel) (struct regulator_dev *); |
| @@ -117,13 +103,12 @@ struct regulator_ops { | |||
| 117 | int (*disable) (struct regulator_dev *); | 103 | int (*disable) (struct regulator_dev *); |
| 118 | int (*is_enabled) (struct regulator_dev *); | 104 | int (*is_enabled) (struct regulator_dev *); |
| 119 | 105 | ||
| 120 | /* get/set regulator operating mode (defined in consumer.h) */ | 106 | /* get/set regulator operating mode (defined in regulator.h) */ |
| 121 | int (*set_mode) (struct regulator_dev *, unsigned int mode); | 107 | int (*set_mode) (struct regulator_dev *, unsigned int mode); |
| 122 | unsigned int (*get_mode) (struct regulator_dev *); | 108 | unsigned int (*get_mode) (struct regulator_dev *); |
| 123 | 109 | ||
| 124 | /* Time taken to enable or set voltage on the regulator */ | 110 | /* Time taken to enable or set voltage on the regulator */ |
| 125 | int (*enable_time) (struct regulator_dev *); | 111 | int (*enable_time) (struct regulator_dev *); |
| 126 | int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay); | ||
| 127 | int (*set_voltage_time_sel) (struct regulator_dev *, | 112 | int (*set_voltage_time_sel) (struct regulator_dev *, |
| 128 | unsigned int old_selector, | 113 | unsigned int old_selector, |
| 129 | unsigned int new_selector); | 114 | unsigned int new_selector); |
| @@ -139,10 +124,6 @@ struct regulator_ops { | |||
| 139 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, | 124 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, |
| 140 | int output_uV, int load_uA); | 125 | int output_uV, int load_uA); |
| 141 | 126 | ||
| 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 | |||
| 146 | /* the operations below are for configuration of regulator state when | 127 | /* the operations below are for configuration of regulator state when |
| 147 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ | 128 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ |
| 148 | 129 | ||
| @@ -153,7 +134,7 @@ struct regulator_ops { | |||
| 153 | int (*set_suspend_enable) (struct regulator_dev *); | 134 | int (*set_suspend_enable) (struct regulator_dev *); |
| 154 | int (*set_suspend_disable) (struct regulator_dev *); | 135 | int (*set_suspend_disable) (struct regulator_dev *); |
| 155 | 136 | ||
| 156 | /* set regulator suspend operating mode (defined in consumer.h) */ | 137 | /* set regulator suspend operating mode (defined in regulator.h) */ |
| 157 | int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); | 138 | int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); |
| 158 | }; | 139 | }; |
| 159 | 140 | ||
| @@ -166,94 +147,27 @@ enum regulator_type { | |||
| 166 | }; | 147 | }; |
| 167 | 148 | ||
| 168 | /** | 149 | /** |
| 169 | * struct regulator_desc - Static regulator descriptor | 150 | * struct regulator_desc - Regulator descriptor |
| 170 | * | 151 | * |
| 171 | * Each regulator registered with the core is described with a | 152 | * Each regulator registered with the core is described with a structure of |
| 172 | * structure of this type and a struct regulator_config. This | 153 | * this type. |
| 173 | * structure contains the non-varying parts of the regulator | ||
| 174 | * description. | ||
| 175 | * | 154 | * |
| 176 | * @name: Identifying name for the regulator. | 155 | * @name: Identifying name for the regulator. |
| 177 | * @supply_name: Identifying the regulator supply | ||
| 178 | * @id: Numerical identifier for the regulator. | 156 | * @id: Numerical identifier for the regulator. |
| 157 | * @n_voltages: Number of selectors available for ops.list_voltage(). | ||
| 179 | * @ops: Regulator operations table. | 158 | * @ops: Regulator operations table. |
| 180 | * @irq: Interrupt number for the regulator. | 159 | * @irq: Interrupt number for the regulator. |
| 181 | * @type: Indicates if the regulator is a voltage or current regulator. | 160 | * @type: Indicates if the regulator is a voltage or current regulator. |
| 182 | * @owner: Module providing the regulator, used for refcounting. | 161 | * @owner: Module providing the regulator, used for refcounting. |
| 183 | * | ||
| 184 | * @continuous_voltage_range: Indicates if the regulator can set any | ||
| 185 | * voltage within constrains range. | ||
| 186 | * @n_voltages: Number of selectors available for ops.list_voltage(). | ||
| 187 | * | ||
| 188 | * @min_uV: Voltage given by the lowest selector (if linear mapping) | ||
| 189 | * @uV_step: Voltage increase with each selector (if linear mapping) | ||
| 190 | * @linear_min_sel: Minimal selector for starting linear mapping | ||
| 191 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) | ||
| 192 | * @volt_table: Voltage mapping table (if table based mapping) | ||
| 193 | * | ||
| 194 | * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_ | ||
| 195 | * @vsel_mask: Mask for register bitfield used for selector | ||
| 196 | * @enable_reg: Register for control when using regmap enable/disable ops | ||
| 197 | * @enable_mask: Mask for control when using regmap enable/disable ops | ||
| 198 | * | ||
| 199 | * @enable_time: Time taken for initial enable of regulator (in uS). | ||
| 200 | */ | 162 | */ |
| 201 | struct regulator_desc { | 163 | struct regulator_desc { |
| 202 | const char *name; | 164 | const char *name; |
| 203 | const char *supply_name; | ||
| 204 | int id; | 165 | int id; |
| 205 | bool continuous_voltage_range; | ||
| 206 | unsigned n_voltages; | 166 | unsigned n_voltages; |
| 207 | struct regulator_ops *ops; | 167 | struct regulator_ops *ops; |
| 208 | int irq; | 168 | int irq; |
| 209 | enum regulator_type type; | 169 | enum regulator_type type; |
| 210 | struct module *owner; | 170 | struct module *owner; |
| 211 | |||
| 212 | unsigned int min_uV; | ||
| 213 | unsigned int uV_step; | ||
| 214 | unsigned int linear_min_sel; | ||
| 215 | unsigned int ramp_delay; | ||
| 216 | |||
| 217 | const unsigned int *volt_table; | ||
| 218 | |||
| 219 | unsigned int vsel_reg; | ||
| 220 | unsigned int vsel_mask; | ||
| 221 | unsigned int enable_reg; | ||
| 222 | unsigned int enable_mask; | ||
| 223 | unsigned int bypass_reg; | ||
| 224 | unsigned int bypass_mask; | ||
| 225 | |||
| 226 | unsigned int enable_time; | ||
| 227 | }; | ||
| 228 | |||
| 229 | /** | ||
| 230 | * struct regulator_config - Dynamic regulator descriptor | ||
| 231 | * | ||
| 232 | * Each regulator registered with the core is described with a | ||
| 233 | * structure of this type and a struct regulator_desc. This structure | ||
| 234 | * contains the runtime variable parts of the regulator description. | ||
| 235 | * | ||
| 236 | * @dev: struct device for the regulator | ||
| 237 | * @init_data: platform provided init data, passed through by driver | ||
| 238 | * @driver_data: private regulator data | ||
| 239 | * @of_node: OpenFirmware node to parse for device tree bindings (may be | ||
| 240 | * NULL). | ||
| 241 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is | ||
| 242 | * insufficient. | ||
| 243 | * @ena_gpio: GPIO controlling regulator enable. | ||
| 244 | * @ena_gpio_invert: Sense for GPIO enable control. | ||
| 245 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() | ||
| 246 | */ | ||
| 247 | struct regulator_config { | ||
| 248 | struct device *dev; | ||
| 249 | const struct regulator_init_data *init_data; | ||
| 250 | void *driver_data; | ||
| 251 | struct device_node *of_node; | ||
| 252 | struct regmap *regmap; | ||
| 253 | |||
| 254 | int ena_gpio; | ||
| 255 | unsigned int ena_gpio_invert:1; | ||
| 256 | unsigned int ena_gpio_flags; | ||
| 257 | }; | 171 | }; |
| 258 | 172 | ||
| 259 | /* | 173 | /* |
| @@ -267,11 +181,10 @@ struct regulator_config { | |||
| 267 | * no other direct access). | 181 | * no other direct access). |
| 268 | */ | 182 | */ |
| 269 | struct regulator_dev { | 183 | struct regulator_dev { |
| 270 | const struct regulator_desc *desc; | 184 | struct regulator_desc *desc; |
| 271 | int exclusive; | 185 | int exclusive; |
| 272 | u32 use_count; | 186 | u32 use_count; |
| 273 | u32 open_count; | 187 | u32 open_count; |
| 274 | u32 bypass_count; | ||
| 275 | 188 | ||
| 276 | /* lists we belong to */ | 189 | /* lists we belong to */ |
| 277 | struct list_head list; /* list of all regulators */ | 190 | struct list_head list; /* list of all regulators */ |
| @@ -285,23 +198,17 @@ struct regulator_dev { | |||
| 285 | struct device dev; | 198 | struct device dev; |
| 286 | struct regulation_constraints *constraints; | 199 | struct regulation_constraints *constraints; |
| 287 | struct regulator *supply; /* for tree */ | 200 | struct regulator *supply; /* for tree */ |
| 288 | struct regmap *regmap; | ||
| 289 | |||
| 290 | struct delayed_work disable_work; | ||
| 291 | int deferred_disables; | ||
| 292 | 201 | ||
| 293 | void *reg_data; /* regulator_dev data */ | 202 | void *reg_data; /* regulator_dev data */ |
| 294 | 203 | ||
| 204 | #ifdef CONFIG_DEBUG_FS | ||
| 295 | struct dentry *debugfs; | 205 | struct dentry *debugfs; |
| 296 | 206 | #endif | |
| 297 | int ena_gpio; | ||
| 298 | unsigned int ena_gpio_invert:1; | ||
| 299 | unsigned int ena_gpio_state:1; | ||
| 300 | }; | 207 | }; |
| 301 | 208 | ||
| 302 | struct regulator_dev * | 209 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
| 303 | regulator_register(const struct regulator_desc *regulator_desc, | 210 | struct device *dev, const struct regulator_init_data *init_data, |
| 304 | const struct regulator_config *config); | 211 | void *driver_data); |
| 305 | void regulator_unregister(struct regulator_dev *rdev); | 212 | void regulator_unregister(struct regulator_dev *rdev); |
| 306 | 213 | ||
| 307 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 214 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
| @@ -313,25 +220,6 @@ int rdev_get_id(struct regulator_dev *rdev); | |||
| 313 | 220 | ||
| 314 | int regulator_mode_to_status(unsigned int); | 221 | int regulator_mode_to_status(unsigned int); |
| 315 | 222 | ||
| 316 | int regulator_list_voltage_linear(struct regulator_dev *rdev, | ||
| 317 | unsigned int selector); | ||
| 318 | int regulator_list_voltage_table(struct regulator_dev *rdev, | ||
| 319 | unsigned int selector); | ||
| 320 | int regulator_map_voltage_linear(struct regulator_dev *rdev, | ||
| 321 | int min_uV, int max_uV); | ||
| 322 | int regulator_map_voltage_iterate(struct regulator_dev *rdev, | ||
| 323 | int min_uV, int max_uV); | ||
| 324 | int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev); | ||
| 325 | int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel); | ||
| 326 | int regulator_is_enabled_regmap(struct regulator_dev *rdev); | ||
| 327 | int regulator_enable_regmap(struct regulator_dev *rdev); | ||
| 328 | int regulator_disable_regmap(struct regulator_dev *rdev); | ||
| 329 | int regulator_set_voltage_time_sel(struct regulator_dev *rdev, | ||
| 330 | unsigned int old_selector, | ||
| 331 | unsigned int new_selector); | ||
| 332 | int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable); | ||
| 333 | int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable); | ||
| 334 | |||
| 335 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); | 223 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); |
| 336 | 224 | ||
| 337 | #endif | 225 | #endif |
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h deleted file mode 100644 index 5c45c85d52c..00000000000 --- a/include/linux/regulator/fan53555.h +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * fan53555.h - Fairchild Regulator FAN53555 Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Marvell Technology Ltd. | ||
| 5 | * Yunfan Zhang <yfzhang@marvell.com> | ||
| 6 | * | ||
| 7 | * This package is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __FAN53555_H__ | ||
| 14 | |||
| 15 | /* VSEL ID */ | ||
| 16 | enum { | ||
| 17 | FAN53555_VSEL_ID_0 = 0, | ||
| 18 | FAN53555_VSEL_ID_1, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* Transition slew rate limiting from a low to high voltage. | ||
| 22 | * ----------------------- | ||
| 23 | * Bin |Slew Rate(mV/uS) | ||
| 24 | * ------|---------------- | ||
| 25 | * 000 | 64.00 | ||
| 26 | * ------|---------------- | ||
| 27 | * 001 | 32.00 | ||
| 28 | * ------|---------------- | ||
| 29 | * 010 | 16.00 | ||
| 30 | * ------|---------------- | ||
| 31 | * 011 | 8.00 | ||
| 32 | * ------|---------------- | ||
| 33 | * 100 | 4.00 | ||
| 34 | * ------|---------------- | ||
| 35 | * 101 | 2.00 | ||
| 36 | * ------|---------------- | ||
| 37 | * 110 | 1.00 | ||
| 38 | * ------|---------------- | ||
| 39 | * 111 | 0.50 | ||
| 40 | * ----------------------- | ||
| 41 | */ | ||
| 42 | enum { | ||
| 43 | FAN53555_SLEW_RATE_64MV = 0, | ||
| 44 | FAN53555_SLEW_RATE_32MV, | ||
| 45 | FAN53555_SLEW_RATE_16MV, | ||
| 46 | FAN53555_SLEW_RATE_8MV, | ||
| 47 | FAN53555_SLEW_RATE_4MV, | ||
| 48 | FAN53555_SLEW_RATE_2MV, | ||
| 49 | FAN53555_SLEW_RATE_1MV, | ||
| 50 | FAN53555_SLEW_RATE_0_5MV, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct fan53555_platform_data { | ||
| 54 | struct regulator_init_data *regulator; | ||
| 55 | unsigned int slew_rate; | ||
| 56 | /* Sleep VSEL ID */ | ||
| 57 | unsigned int sleep_vsel_id; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif /* __FAN53555_H__ */ | ||
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h index 48918be649d..ffd7d508e72 100644 --- a/include/linux/regulator/fixed.h +++ b/include/linux/regulator/fixed.h | |||
| @@ -22,17 +22,10 @@ struct regulator_init_data; | |||
| 22 | /** | 22 | /** |
| 23 | * struct fixed_voltage_config - fixed_voltage_config structure | 23 | * struct fixed_voltage_config - fixed_voltage_config structure |
| 24 | * @supply_name: Name of the regulator supply | 24 | * @supply_name: Name of the regulator supply |
| 25 | * @input_supply: Name of the input regulator supply | ||
| 26 | * @microvolts: Output voltage of regulator | 25 | * @microvolts: Output voltage of regulator |
| 27 | * @gpio: GPIO to use for enable control | 26 | * @gpio: GPIO to use for enable control |
| 28 | * set to -EINVAL if not used | 27 | * set to -EINVAL if not used |
| 29 | * @startup_delay: Start-up time in microseconds | 28 | * @startup_delay: Start-up time in microseconds |
| 30 | * @gpio_is_open_drain: Gpio pin is open drain or normal type. | ||
| 31 | * If it is open drain type then HIGH will be set | ||
| 32 | * through PULL-UP with setting gpio as input | ||
| 33 | * and low will be set as gpio-output with driven | ||
| 34 | * to low. For non-open-drain case, the gpio will | ||
| 35 | * will be in output and drive to low/high accordingly. | ||
| 36 | * @enable_high: Polarity of enable GPIO | 29 | * @enable_high: Polarity of enable GPIO |
| 37 | * 1 = Active high, 0 = Active low | 30 | * 1 = Active high, 0 = Active low |
| 38 | * @enabled_at_boot: Whether regulator has been enabled at | 31 | * @enabled_at_boot: Whether regulator has been enabled at |
| @@ -47,30 +40,12 @@ struct regulator_init_data; | |||
| 47 | */ | 40 | */ |
| 48 | struct fixed_voltage_config { | 41 | struct fixed_voltage_config { |
| 49 | const char *supply_name; | 42 | const char *supply_name; |
| 50 | const char *input_supply; | ||
| 51 | int microvolts; | 43 | int microvolts; |
| 52 | int gpio; | 44 | int gpio; |
| 53 | unsigned startup_delay; | 45 | unsigned startup_delay; |
| 54 | unsigned gpio_is_open_drain:1; | ||
| 55 | unsigned enable_high:1; | 46 | unsigned enable_high:1; |
| 56 | unsigned enabled_at_boot:1; | 47 | unsigned enabled_at_boot:1; |
| 57 | struct regulator_init_data *init_data; | 48 | struct regulator_init_data *init_data; |
| 58 | }; | 49 | }; |
| 59 | 50 | ||
| 60 | struct regulator_consumer_supply; | ||
| 61 | |||
| 62 | #if IS_ENABLED(CONFIG_REGULATOR) | ||
| 63 | struct platform_device *regulator_register_always_on(int id, const char *name, | ||
| 64 | struct regulator_consumer_supply *supplies, int num_supplies, int uv); | ||
| 65 | #else | ||
| 66 | static inline struct platform_device *regulator_register_always_on(int id, const char *name, | ||
| 67 | struct regulator_consumer_supply *supplies, int num_supplies, int uv) | ||
| 68 | { | ||
| 69 | return NULL; | ||
| 70 | } | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \ | ||
| 74 | "fixed-dummy", s, ns, 0) | ||
| 75 | |||
| 76 | #endif | 51 | #endif |
diff --git a/include/linux/regulator/lp872x.h b/include/linux/regulator/lp872x.h deleted file mode 100644 index 132e05c4666..00000000000 --- a/include/linux/regulator/lp872x.h +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Texas Instruments | ||
| 3 | * | ||
| 4 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LP872X_REGULATOR_H__ | ||
| 13 | #define __LP872X_REGULATOR_H__ | ||
| 14 | |||
| 15 | #include <linux/regulator/machine.h> | ||
| 16 | #include <linux/platform_device.h> | ||
| 17 | #include <linux/gpio.h> | ||
| 18 | |||
| 19 | #define LP872X_MAX_REGULATORS 9 | ||
| 20 | |||
| 21 | enum lp872x_regulator_id { | ||
| 22 | LP8720_ID_BASE, | ||
| 23 | LP8720_ID_LDO1 = LP8720_ID_BASE, | ||
| 24 | LP8720_ID_LDO2, | ||
| 25 | LP8720_ID_LDO3, | ||
| 26 | LP8720_ID_LDO4, | ||
| 27 | LP8720_ID_LDO5, | ||
| 28 | LP8720_ID_BUCK, | ||
| 29 | |||
| 30 | LP8725_ID_BASE, | ||
| 31 | LP8725_ID_LDO1 = LP8725_ID_BASE, | ||
| 32 | LP8725_ID_LDO2, | ||
| 33 | LP8725_ID_LDO3, | ||
| 34 | LP8725_ID_LDO4, | ||
| 35 | LP8725_ID_LDO5, | ||
| 36 | LP8725_ID_LILO1, | ||
| 37 | LP8725_ID_LILO2, | ||
| 38 | LP8725_ID_BUCK1, | ||
| 39 | LP8725_ID_BUCK2, | ||
| 40 | |||
| 41 | LP872X_ID_MAX, | ||
| 42 | }; | ||
| 43 | |||
| 44 | enum lp872x_dvs_state { | ||
| 45 | DVS_LOW = GPIOF_OUT_INIT_LOW, | ||
| 46 | DVS_HIGH = GPIOF_OUT_INIT_HIGH, | ||
| 47 | }; | ||
| 48 | |||
| 49 | enum lp872x_dvs_sel { | ||
| 50 | SEL_V1, | ||
| 51 | SEL_V2, | ||
| 52 | }; | ||
| 53 | |||
| 54 | /** | ||
| 55 | * lp872x_dvs | ||
| 56 | * @gpio : gpio pin number for dvs control | ||
| 57 | * @vsel : dvs selector for buck v1 or buck v2 register | ||
| 58 | * @init_state : initial dvs pin state | ||
| 59 | */ | ||
| 60 | struct lp872x_dvs { | ||
| 61 | int gpio; | ||
| 62 | enum lp872x_dvs_sel vsel; | ||
| 63 | enum lp872x_dvs_state init_state; | ||
| 64 | }; | ||
| 65 | |||
| 66 | /** | ||
| 67 | * lp872x_regdata | ||
| 68 | * @id : regulator id | ||
| 69 | * @init_data : init data for each regulator | ||
| 70 | */ | ||
| 71 | struct lp872x_regulator_data { | ||
| 72 | enum lp872x_regulator_id id; | ||
| 73 | struct regulator_init_data *init_data; | ||
| 74 | }; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * lp872x_platform_data | ||
| 78 | * @general_config : the value of LP872X_GENERAL_CFG register | ||
| 79 | * @update_config : if LP872X_GENERAL_CFG register is updated, set true | ||
| 80 | * @regulator_data : platform regulator id and init data | ||
| 81 | * @dvs : dvs data for buck voltage control | ||
| 82 | */ | ||
| 83 | struct lp872x_platform_data { | ||
| 84 | u8 general_config; | ||
| 85 | bool update_config; | ||
| 86 | struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS]; | ||
| 87 | struct lp872x_dvs *dvs; | ||
| 88 | }; | ||
| 89 | |||
| 90 | #endif | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 36adbc82de6..ce3127a75c8 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -32,7 +32,6 @@ struct regulator; | |||
| 32 | * board/machine. | 32 | * board/machine. |
| 33 | * STATUS: Regulator can be enabled and disabled. | 33 | * STATUS: Regulator can be enabled and disabled. |
| 34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. | 34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. |
| 35 | * BYPASS: Regulator can be put into bypass mode | ||
| 36 | */ | 35 | */ |
| 37 | 36 | ||
| 38 | #define REGULATOR_CHANGE_VOLTAGE 0x1 | 37 | #define REGULATOR_CHANGE_VOLTAGE 0x1 |
| @@ -40,7 +39,6 @@ struct regulator; | |||
| 40 | #define REGULATOR_CHANGE_MODE 0x4 | 39 | #define REGULATOR_CHANGE_MODE 0x4 |
| 41 | #define REGULATOR_CHANGE_STATUS 0x8 | 40 | #define REGULATOR_CHANGE_STATUS 0x8 |
| 42 | #define REGULATOR_CHANGE_DRMS 0x10 | 41 | #define REGULATOR_CHANGE_DRMS 0x10 |
| 43 | #define REGULATOR_CHANGE_BYPASS 0x20 | ||
| 44 | 42 | ||
| 45 | /** | 43 | /** |
| 46 | * struct regulator_state - regulator state during low power system states | 44 | * struct regulator_state - regulator state during low power system states |
| @@ -73,7 +71,7 @@ struct regulator_state { | |||
| 73 | * @uV_offset: Offset applied to voltages from consumer to compensate for | 71 | * @uV_offset: Offset applied to voltages from consumer to compensate for |
| 74 | * voltage drops. | 72 | * voltage drops. |
| 75 | * | 73 | * |
| 76 | * @min_uA: Smallest current consumers may set. | 74 | * @min_uA: Smallest consumers consumers may set. |
| 77 | * @max_uA: Largest current consumers may set. | 75 | * @max_uA: Largest current consumers may set. |
| 78 | * | 76 | * |
| 79 | * @valid_modes_mask: Mask of modes which may be configured by consumers. | 77 | * @valid_modes_mask: Mask of modes which may be configured by consumers. |
| @@ -94,11 +92,10 @@ struct regulator_state { | |||
| 94 | * mode. | 92 | * mode. |
| 95 | * @initial_state: Suspend state to set by default. | 93 | * @initial_state: Suspend state to set by default. |
| 96 | * @initial_mode: Mode to set at startup. | 94 | * @initial_mode: Mode to set at startup. |
| 97 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) | ||
| 98 | */ | 95 | */ |
| 99 | struct regulation_constraints { | 96 | struct regulation_constraints { |
| 100 | 97 | ||
| 101 | const char *name; | 98 | char *name; |
| 102 | 99 | ||
| 103 | /* voltage output range (inclusive) - for voltage control */ | 100 | /* voltage output range (inclusive) - for voltage control */ |
| 104 | int min_uV; | 101 | int min_uV; |
| @@ -128,8 +125,6 @@ struct regulation_constraints { | |||
| 128 | /* mode to set on startup */ | 125 | /* mode to set on startup */ |
| 129 | unsigned int initial_mode; | 126 | unsigned int initial_mode; |
| 130 | 127 | ||
| 131 | unsigned int ramp_delay; | ||
| 132 | |||
| 133 | /* constraint flags */ | 128 | /* constraint flags */ |
| 134 | unsigned always_on:1; /* regulator never off when system is on */ | 129 | unsigned always_on:1; /* regulator never off when system is on */ |
| 135 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 130 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |
| @@ -139,13 +134,17 @@ struct regulation_constraints { | |||
| 139 | /** | 134 | /** |
| 140 | * struct regulator_consumer_supply - supply -> device mapping | 135 | * struct regulator_consumer_supply - supply -> device mapping |
| 141 | * | 136 | * |
| 142 | * This maps a supply name to a device. Use of dev_name allows support for | 137 | * This maps a supply name to a device. Only one of dev or dev_name |
| 143 | * buses which make struct device available late such as I2C. | 138 | * can be specified. Use of dev_name allows support for buses which |
| 139 | * make struct device available late such as I2C and is the preferred | ||
| 140 | * form. | ||
| 144 | * | 141 | * |
| 142 | * @dev: Device structure for the consumer. | ||
| 145 | * @dev_name: Result of dev_name() for the consumer. | 143 | * @dev_name: Result of dev_name() for the consumer. |
| 146 | * @supply: Name for the supply. | 144 | * @supply: Name for the supply. |
| 147 | */ | 145 | */ |
| 148 | struct regulator_consumer_supply { | 146 | struct regulator_consumer_supply { |
| 147 | struct device *dev; /* consumer */ | ||
| 149 | const char *dev_name; /* dev_name() for consumer */ | 148 | const char *dev_name; /* dev_name() for consumer */ |
| 150 | const char *supply; /* consumer supply - e.g. "vcc" */ | 149 | const char *supply; /* consumer supply - e.g. "vcc" */ |
| 151 | }; | 150 | }; |
diff --git a/include/linux/regulator/max8973-regulator.h b/include/linux/regulator/max8973-regulator.h deleted file mode 100644 index f8acc052e35..00000000000 --- a/include/linux/regulator/max8973-regulator.h +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * max8973-regulator.h -- MAXIM 8973 regulator | ||
| 3 | * | ||
| 4 | * Interface for regulator driver for MAXIM 8973 DC-DC step-down | ||
| 5 | * switching regulator. | ||
| 6 | * | ||
| 7 | * Copyright (C) 2012 NVIDIA Corporation | ||
| 8 | |||
| 9 | * Author: Laxman Dewangan <ldewangan@nvidia.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License along | ||
| 22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __LINUX_REGULATOR_MAX8973_H | ||
| 28 | #define __LINUX_REGULATOR_MAX8973_H | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Control flags for configuration of the device. | ||
| 32 | * Client need to pass this information with ORed | ||
| 33 | */ | ||
| 34 | #define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001 | ||
| 35 | #define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002 | ||
| 36 | #define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004 | ||
| 37 | #define MAX8973_CONTROL_BIAS_ENABLE 0x00000008 | ||
| 38 | #define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010 | ||
| 39 | #define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020 | ||
| 40 | |||
| 41 | #define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000 | ||
| 42 | #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000 | ||
| 43 | #define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000 | ||
| 44 | #define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000 | ||
| 45 | |||
| 46 | #define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000 | ||
| 47 | #define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000 | ||
| 48 | #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000 | ||
| 49 | #define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000 | ||
| 50 | |||
| 51 | /* | ||
| 52 | * struct max8973_regulator_platform_data - max8973 regulator platform data. | ||
| 53 | * | ||
| 54 | * @reg_init_data: The regulator init data. | ||
| 55 | * @control_flags: Control flags which are ORed value of above flags to | ||
| 56 | * configure device. | ||
| 57 | * @enable_ext_control: Enable the voltage enable/disable through external | ||
| 58 | * control signal from EN input pin. If it is false then | ||
| 59 | * voltage output will be enabled/disabled through EN bit of | ||
| 60 | * device register. | ||
| 61 | * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic. | ||
| 62 | * @dvs_def_state: Default state of dvs. 1 if it is high else 0. | ||
| 63 | */ | ||
| 64 | struct max8973_regulator_platform_data { | ||
| 65 | struct regulator_init_data *reg_init_data; | ||
| 66 | unsigned long control_flags; | ||
| 67 | bool enable_ext_control; | ||
| 68 | int dvs_gpio; | ||
| 69 | unsigned dvs_def_state:1; | ||
| 70 | }; | ||
| 71 | |||
| 72 | #endif /* __LINUX_REGULATOR_MAX8973_H */ | ||
diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h deleted file mode 100644 index f9217965aaa..00000000000 --- a/include/linux/regulator/of_regulator.h +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * OpenFirmware regulator support routines | ||
| 3 | * | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __LINUX_OF_REG_H | ||
| 7 | #define __LINUX_OF_REG_H | ||
| 8 | |||
| 9 | struct of_regulator_match { | ||
| 10 | const char *name; | ||
| 11 | void *driver_data; | ||
| 12 | struct regulator_init_data *init_data; | ||
| 13 | struct device_node *of_node; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #if defined(CONFIG_OF) | ||
| 17 | extern struct regulator_init_data | ||
| 18 | *of_get_regulator_init_data(struct device *dev, | ||
| 19 | struct device_node *node); | ||
| 20 | extern int of_regulator_match(struct device *dev, struct device_node *node, | ||
| 21 | struct of_regulator_match *matches, | ||
| 22 | unsigned int num_matches); | ||
| 23 | #else | ||
| 24 | static inline struct regulator_init_data | ||
| 25 | *of_get_regulator_init_data(struct device *dev, | ||
| 26 | struct device_node *node) | ||
| 27 | { | ||
| 28 | return NULL; | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline int of_regulator_match(struct device *dev, | ||
| 32 | struct device_node *node, | ||
| 33 | struct of_regulator_match *matches, | ||
| 34 | unsigned int num_matches) | ||
| 35 | { | ||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | #endif /* CONFIG_OF */ | ||
| 39 | |||
| 40 | #endif /* __LINUX_OF_REG_H */ | ||
diff --git a/include/linux/regulator/tps51632-regulator.h b/include/linux/regulator/tps51632-regulator.h deleted file mode 100644 index d00841e1a75..00000000000 --- a/include/linux/regulator/tps51632-regulator.h +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * tps51632-regulator.h -- TPS51632 regulator | ||
| 3 | * | ||
| 4 | * Interface for regulator driver for TPS51632 3-2-1 Phase D-Cap Step Down | ||
| 5 | * Driverless Controller with serial VID control and DVFS. | ||
| 6 | * | ||
| 7 | * Copyright (C) 2012 NVIDIA Corporation | ||
| 8 | |||
| 9 | * Author: Laxman Dewangan <ldewangan@nvidia.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License along | ||
| 22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __LINUX_REGULATOR_TPS51632_H | ||
| 28 | #define __LINUX_REGULATOR_TPS51632_H | ||
| 29 | |||
| 30 | /* | ||
| 31 | * struct tps51632_regulator_platform_data - tps51632 regulator platform data. | ||
| 32 | * | ||
| 33 | * @reg_init_data: The regulator init data. | ||
| 34 | * @enable_pwm_dvfs: Enable PWM DVFS or not. | ||
| 35 | * @dvfs_step_20mV: Step for DVFS is 20mV or 10mV. | ||
| 36 | * @max_voltage_uV: Maximum possible voltage in PWM-DVFS mode. | ||
| 37 | * @base_voltage_uV: Base voltage when PWM-DVFS enabled. | ||
| 38 | */ | ||
| 39 | struct tps51632_regulator_platform_data { | ||
| 40 | struct regulator_init_data *reg_init_data; | ||
| 41 | bool enable_pwm_dvfs; | ||
| 42 | bool dvfs_step_20mV; | ||
| 43 | int max_voltage_uV; | ||
| 44 | int base_voltage_uV; | ||
| 45 | }; | ||
| 46 | |||
| 47 | #endif /* __LINUX_REGULATOR_TPS51632_H */ | ||
diff --git a/include/linux/regulator/tps62360.h b/include/linux/regulator/tps62360.h index a4c49394c49..6a5c1b2c751 100644 --- a/include/linux/regulator/tps62360.h +++ b/include/linux/regulator/tps62360.h | |||
| @@ -26,10 +26,13 @@ | |||
| 26 | #ifndef __LINUX_REGULATOR_TPS62360_H | 26 | #ifndef __LINUX_REGULATOR_TPS62360_H |
| 27 | #define __LINUX_REGULATOR_TPS62360_H | 27 | #define __LINUX_REGULATOR_TPS62360_H |
| 28 | 28 | ||
| 29 | #include <linux/regulator/machine.h> | ||
| 30 | |||
| 29 | /* | 31 | /* |
| 30 | * struct tps62360_regulator_platform_data - tps62360 regulator platform data. | 32 | * struct tps62360_regulator_platform_data - tps62360 regulator platform data. |
| 31 | * | 33 | * |
| 32 | * @reg_init_data: The regulator init data. | 34 | * @reg_init_data: The regulator init data. |
| 35 | * @en_force_pwm: Enable force pwm or not. | ||
| 33 | * @en_discharge: Enable discharge the output capacitor via internal | 36 | * @en_discharge: Enable discharge the output capacitor via internal |
| 34 | * register. | 37 | * register. |
| 35 | * @en_internal_pulldn: internal pull down enable or not. | 38 | * @en_internal_pulldn: internal pull down enable or not. |
| @@ -41,7 +44,8 @@ | |||
| 41 | * @vsel1_def_state: Default state of vsel1. 1 if it is high else 0. | 44 | * @vsel1_def_state: Default state of vsel1. 1 if it is high else 0. |
| 42 | */ | 45 | */ |
| 43 | struct tps62360_regulator_platform_data { | 46 | struct tps62360_regulator_platform_data { |
| 44 | struct regulator_init_data *reg_init_data; | 47 | struct regulator_init_data reg_init_data; |
| 48 | bool en_force_pwm; | ||
| 45 | bool en_discharge; | 49 | bool en_discharge; |
| 46 | bool en_internal_pulldn; | 50 | bool en_internal_pulldn; |
| 47 | int vsel0_gpio; | 51 | int vsel0_gpio; |
