diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-13 19:29:36 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-26 21:38:16 +0000 |
commit | 8817796b75c8847d63d6d4523c79c24b47748a05 (patch) | |
tree | afa323b0fc93ec618da94bc54b40c2047c8a422c /drivers/base/regmap/internal.h | |
parent | 0c7ed8563a0282c032936ae1c667498d59691593 (diff) | |
download | kernel_goldelico_gta04-8817796b75c8847d63d6d4523c79c24b47748a05.zip kernel_goldelico_gta04-8817796b75c8847d63d6d4523c79c24b47748a05.tar.gz kernel_goldelico_gta04-8817796b75c8847d63d6d4523c79c24b47748a05.tar.bz2 |
regmap: cache: Provide a get address of value operation
Provide a helper to do the size based index into a block of registers and
use it when reading a value.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/internal.h')
-rw-r--r-- | drivers/base/regmap/internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index 6d40935..95d46a5 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h @@ -189,6 +189,13 @@ int regcache_write(struct regmap *map, unsigned int reg, unsigned int value); int regcache_sync(struct regmap *map); +static inline const void *regcache_get_val_addr(struct regmap *map, + const void *base, + unsigned int idx) +{ + return base + (map->cache_word_size * idx); +} + unsigned int regcache_get_val(struct regmap *map, const void *base, unsigned int idx); bool regcache_set_val(struct regmap *map, void *base, unsigned int idx, |