summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-11-16 16:28:16 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-16 17:34:53 +0000
commite5e3b8abeda1cf45f5a079458dbc267952694c7a (patch)
tree46bd89885c027beaa4d549ea5f1d79f8a9279433 /drivers/base/regmap/regcache.c
parentc2b1ecd13c6a7b19f1c0c48b68f61ab083f3ec3f (diff)
downloadlinux-e5e3b8abeda1cf45f5a079458dbc267952694c7a.tar.bz2
regmap: Move initialization of regcache related fields to regcache_init
Move the initialization regcache related fields of the regmap struct to regcache_init. This allows us to keep regmap and regcache code better separated. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r--drivers/base/regmap/regcache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 27fae58ff4cb..0ad6cfb2c8cc 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -87,7 +87,7 @@ err_free:
return ret;
}
-int regcache_init(struct regmap *map)
+int regcache_init(struct regmap *map, const struct regmap_config *config)
{
int ret;
int i;
@@ -108,6 +108,13 @@ int regcache_init(struct regmap *map)
return -EINVAL;
}
+ map->reg_defaults = config->reg_defaults;
+ map->num_reg_defaults = config->num_reg_defaults;
+ map->num_reg_defaults_raw = config->num_reg_defaults_raw;
+ map->reg_defaults_raw = config->reg_defaults_raw;
+ map->cache_size_raw = (config->val_bits / 8) * config->num_reg_defaults_raw;
+ map->cache_word_size = config->val_bits / 8;
+
map->cache = NULL;
map->cache_ops = cache_types[i];