aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-13 13:26:25 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-13 13:26:25 +0800
commit875fa8e94841a06b32394e9a4093998abfd844e8 (patch)
treee520471e99596096ff0a8c70e2b81313175d966b /drivers
parent796ba9001dfd5cdf19926f374015e514ea2eaa51 (diff)
parent94f9ec936513b9743996cf89d2f9c8e3110cf0f4 (diff)
Merge branch 'topic/cache' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into for-3.3
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/internal.h2
-rw-r--r--drivers/base/regmap/regcache.c9
-rw-r--r--drivers/base/regmap/regmap.c8
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 6483e0bda0c..954f7b73238 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -106,7 +106,7 @@ static inline void regmap_debugfs_exit(struct regmap *map) { }
#endif
/* regcache core declarations */
-int regcache_init(struct regmap *map);
+int regcache_init(struct regmap *map, const struct regmap_config *config);
void regcache_exit(struct regmap *map);
int regcache_read(struct regmap *map,
unsigned int reg, unsigned int *value);
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 6ab9f0384d8..bd9d01b681d 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];
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 579e85b8a68..44606f7c8ec 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -147,12 +147,6 @@ struct regmap *regmap_init(struct device *dev,
map->volatile_reg = config->volatile_reg;
map->precious_reg = config->precious_reg;
map->cache_type = config->cache_type;
- 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;
if (config->read_flag_mask || config->write_flag_mask) {
map->read_flag_mask = config->read_flag_mask;
@@ -215,7 +209,7 @@ struct regmap *regmap_init(struct device *dev,
goto err_map;
}
- ret = regcache_init(map);
+ ret = regcache_init(map, config);
if (ret < 0)
goto err_map;