diff options
| author | Tuomas Tynkkynen <ttynkkynen@nvidia.com> | 2014-07-21 11:38:48 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-07-25 13:43:48 -0400 |
| commit | 04eca28cde52cdf9eb91e127cc358ad79a8ec53b (patch) | |
| tree | cb4507f5e7f2430325312c86332fbe3ce887879b /include/linux/regulator | |
| parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) | |
regulator: Add helpers for low-level register access
Add helper functions that allow regulator consumers to obtain low-level
details about the regulator hardware, like the voltage selector register
address and such. These details can be useful when configuring hardware
or firmware that want to do low-level access to regulators, with no
involvement from the kernel.
The use-case for Tegra is a voltage-controlled oscillator clocksource
which has control logic to change the supply voltage via I2C to achieve
a desired output clock rate.
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/regulator')
| -rw-r--r-- | include/linux/regulator/consumer.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index a2d9d81038d1..0b1c8d09a6b1 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | struct device; | 38 | struct device; |
| 39 | struct notifier_block; | 39 | struct notifier_block; |
| 40 | struct regmap; | ||
| 40 | 41 | ||
| 41 | /* | 42 | /* |
| 42 | * Regulator operating modes. | 43 | * Regulator operating modes. |
| @@ -215,6 +216,13 @@ int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | |||
| 215 | 216 | ||
| 216 | int regulator_allow_bypass(struct regulator *regulator, bool allow); | 217 | int regulator_allow_bypass(struct regulator *regulator, bool allow); |
| 217 | 218 | ||
| 219 | struct regmap *regulator_get_regmap(struct regulator *regulator); | ||
| 220 | int regulator_get_hardware_vsel_register(struct regulator *regulator, | ||
| 221 | unsigned *vsel_reg, | ||
| 222 | unsigned *vsel_mask); | ||
| 223 | int regulator_list_hardware_vsel(struct regulator *regulator, | ||
| 224 | unsigned selector); | ||
| 225 | |||
| 218 | /* regulator notifier block */ | 226 | /* regulator notifier block */ |
| 219 | int regulator_register_notifier(struct regulator *regulator, | 227 | int regulator_register_notifier(struct regulator *regulator, |
| 220 | struct notifier_block *nb); | 228 | struct notifier_block *nb); |
| @@ -452,6 +460,24 @@ static inline int regulator_allow_bypass(struct regulator *regulator, | |||
| 452 | return 0; | 460 | return 0; |
| 453 | } | 461 | } |
| 454 | 462 | ||
| 463 | struct regmap *regulator_get_regmap(struct regulator *regulator) | ||
| 464 | { | ||
| 465 | return ERR_PTR(-EOPNOTSUPP); | ||
| 466 | } | ||
| 467 | |||
| 468 | int regulator_get_hardware_vsel_register(struct regulator *regulator, | ||
| 469 | unsigned *vsel_reg, | ||
| 470 | unsigned *vsel_mask) | ||
| 471 | { | ||
| 472 | return -EOPNOTSUPP; | ||
| 473 | } | ||
| 474 | |||
| 475 | int regulator_list_hardware_vsel(struct regulator *regulator, | ||
| 476 | unsigned selector) | ||
| 477 | { | ||
| 478 | return -EOPNOTSUPP; | ||
| 479 | } | ||
| 480 | |||
| 455 | static inline int regulator_register_notifier(struct regulator *regulator, | 481 | static inline int regulator_register_notifier(struct regulator *regulator, |
| 456 | struct notifier_block *nb) | 482 | struct notifier_block *nb) |
| 457 | { | 483 | { |
