diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-11-16 15:28:16 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 04:55:06 (GMT) |
commit | 94f9ec936513b9743996cf89d2f9c8e3110cf0f4 (patch) | |
tree | ad72b43fa607269ce963bc791f9eda3ea68ca2f9 /drivers/base/regmap/regcache.c | |
parent | bf315173359b2f3b8b8ccca4264815e91f30be12 (diff) | |
download | linux-94f9ec936513b9743996cf89d2f9c8e3110cf0f4.tar.xz |
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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 6ab9f03..bd9d01b6 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -79,7 +79,7 @@ static int regcache_hw_init(struct regmap *map) return 0; } -int regcache_init(struct regmap *map) +int regcache_init(struct regmap *map, const struct regmap_config *config) { int ret; int i; @@ -100,6 +100,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]; |