Commit 668abc72 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown

regmap: Introduce regmap_get_max_register

This patch introduces regmap_get_max_register() function which would be
used by the infrastructures like nvmem framework built on top of
regmap.
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b787f68c
...@@ -2613,6 +2613,18 @@ int regmap_get_val_bytes(struct regmap *map) ...@@ -2613,6 +2613,18 @@ int regmap_get_val_bytes(struct regmap *map)
} }
EXPORT_SYMBOL_GPL(regmap_get_val_bytes); EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
/**
* regmap_get_max_register(): Report the max register value
*
* Report the max register value, mainly intended to for use by
* generic infrastructure built on top of regmap.
*/
int regmap_get_max_register(struct regmap *map)
{
return map->max_register ? map->max_register : -EINVAL;
}
EXPORT_SYMBOL_GPL(regmap_get_max_register);
int regmap_parse_val(struct regmap *map, const void *buf, int regmap_parse_val(struct regmap *map, const void *buf,
unsigned int *val) unsigned int *val)
{ {
......
...@@ -433,6 +433,7 @@ int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, ...@@ -433,6 +433,7 @@ int regmap_update_bits_check_async(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val, unsigned int mask, unsigned int val,
bool *change); bool *change);
int regmap_get_val_bytes(struct regmap *map); int regmap_get_val_bytes(struct regmap *map);
int regmap_get_max_register(struct regmap *map);
int regmap_async_complete(struct regmap *map); int regmap_async_complete(struct regmap *map);
bool regmap_can_raw_write(struct regmap *map); bool regmap_can_raw_write(struct regmap *map);
...@@ -676,6 +677,12 @@ static inline int regmap_get_val_bytes(struct regmap *map) ...@@ -676,6 +677,12 @@ static inline int regmap_get_val_bytes(struct regmap *map)
return -EINVAL; return -EINVAL;
} }
static inline int regmap_get_max_register(struct regmap *map)
{
WARN_ONCE(1, "regmap API is disabled");
return -EINVAL;
}
static inline int regcache_sync(struct regmap *map) static inline int regcache_sync(struct regmap *map)
{ {
WARN_ONCE(1, "regmap API is disabled"); WARN_ONCE(1, "regmap API is disabled");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment