diff options
| author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2014-11-10 08:43:52 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2014-11-26 13:58:14 -0500 |
| commit | 87e1e0f29f703e91c54e81f05d831432ec659dde (patch) | |
| tree | a22e2d064e7c8c019da8558ae61de9fed58979e2 /include | |
| parent | 218094c975e03b3b202663901a3bbf91041fdd20 (diff) | |
regulator: Add mode mapping function to struct regulator_desc
The "regulator-initial-mode" and "regulator-mode" DT properties allows
to configure the regulator operating modes at startup or when a system
enters into a susend state.
But these properties use as valid values the operating modes supported
by each device while the core deals with the standard operating modes.
So a mapping function is needed to translate from the hardware specific
modes to the standard ones.
This mapping is a non-varying configuration for each regulator, so add
a function pointer to struct regulator_desc that will allow drivers to
define their callback to do the modes translation.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/regulator/driver.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index fc0ee0ce8325..73dd073afef5 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -243,6 +243,8 @@ enum regulator_type { | |||
| 243 | * | 243 | * |
| 244 | * @enable_time: Time taken for initial enable of regulator (in uS). | 244 | * @enable_time: Time taken for initial enable of regulator (in uS). |
| 245 | * @off_on_delay: guard time (in uS), before re-enabling a regulator | 245 | * @off_on_delay: guard time (in uS), before re-enabling a regulator |
| 246 | * | ||
| 247 | * @of_map_mode: Maps a hardware mode defined in a DeviceTree to a standard mode | ||
| 246 | */ | 248 | */ |
| 247 | struct regulator_desc { | 249 | struct regulator_desc { |
| 248 | const char *name; | 250 | const char *name; |
| @@ -285,6 +287,8 @@ struct regulator_desc { | |||
| 285 | unsigned int enable_time; | 287 | unsigned int enable_time; |
| 286 | 288 | ||
| 287 | unsigned int off_on_delay; | 289 | unsigned int off_on_delay; |
| 290 | |||
| 291 | unsigned int (*of_map_mode)(unsigned int mode); | ||
| 288 | }; | 292 | }; |
| 289 | 293 | ||
| 290 | /** | 294 | /** |
