diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-08 12:44:40 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-08 13:19:15 -0400 |
commit | 72b39f6f2b5a6b0beff14b80bed9756f151218a9 (patch) | |
tree | c5e2688207b1c796413debfb1936ededf4493edc /include/linux/regmap.h | |
parent | 851960ba7cb38a6a108d102e4c8b0ab702972e22 (diff) |
regmap: Implement dev_get_regmap()
Use devres to implement dev_get_regmap(). This should mean that in almost
all cases devices wishing to take advantage of framework features based on
regmap shouldn't need to explicitly pass the regmap into the framework.
This simplifies device setup a bit.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index f6abc8d33d64..90a4652eaaea 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -156,6 +156,7 @@ struct regmap *devm_regmap_init_mmio(struct device *dev, | |||
156 | void regmap_exit(struct regmap *map); | 156 | void regmap_exit(struct regmap *map); |
157 | int regmap_reinit_cache(struct regmap *map, | 157 | int regmap_reinit_cache(struct regmap *map, |
158 | const struct regmap_config *config); | 158 | const struct regmap_config *config); |
159 | struct regmap *dev_get_regmap(struct device *dev, const char *name); | ||
159 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 160 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
160 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 161 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
161 | const void *val, size_t val_len); | 162 | const void *val, size_t val_len); |
@@ -340,6 +341,13 @@ static inline int regmap_register_patch(struct regmap *map, | |||
340 | return -EINVAL; | 341 | return -EINVAL; |
341 | } | 342 | } |
342 | 343 | ||
344 | static inline struct regmap *dev_get_regmap(struct device *dev, | ||
345 | const char *name) | ||
346 | { | ||
347 | WARN_ONCE(1, "regmap API is disabled"); | ||
348 | return NULL; | ||
349 | } | ||
350 | |||
343 | #endif | 351 | #endif |
344 | 352 | ||
345 | #endif | 353 | #endif |