Commit 875fa8e9 authored by Mark Brown's avatar Mark Brown

Merge branch 'topic/cache' of...

Merge branch 'topic/cache' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into for-3.3
parents 796ba900 94f9ec93
...@@ -106,7 +106,7 @@ static inline void regmap_debugfs_exit(struct regmap *map) { } ...@@ -106,7 +106,7 @@ static inline void regmap_debugfs_exit(struct regmap *map) { }
#endif #endif
/* regcache core declarations */ /* 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); void regcache_exit(struct regmap *map);
int regcache_read(struct regmap *map, int regcache_read(struct regmap *map,
unsigned int reg, unsigned int *value); unsigned int reg, unsigned int *value);
......
...@@ -79,7 +79,7 @@ static int regcache_hw_init(struct regmap *map) ...@@ -79,7 +79,7 @@ static int regcache_hw_init(struct regmap *map)
return 0; return 0;
} }
int regcache_init(struct regmap *map) int regcache_init(struct regmap *map, const struct regmap_config *config)
{ {
int ret; int ret;
int i; int i;
...@@ -100,6 +100,13 @@ int regcache_init(struct regmap *map) ...@@ -100,6 +100,13 @@ int regcache_init(struct regmap *map)
return -EINVAL; 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 = NULL;
map->cache_ops = cache_types[i]; map->cache_ops = cache_types[i];
......
...@@ -147,12 +147,6 @@ struct regmap *regmap_init(struct device *dev, ...@@ -147,12 +147,6 @@ struct regmap *regmap_init(struct device *dev,
map->volatile_reg = config->volatile_reg; map->volatile_reg = config->volatile_reg;
map->precious_reg = config->precious_reg; map->precious_reg = config->precious_reg;
map->cache_type = config->cache_type; 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) { if (config->read_flag_mask || config->write_flag_mask) {
map->read_flag_mask = config->read_flag_mask; map->read_flag_mask = config->read_flag_mask;
...@@ -215,7 +209,7 @@ struct regmap *regmap_init(struct device *dev, ...@@ -215,7 +209,7 @@ struct regmap *regmap_init(struct device *dev,
goto err_map; goto err_map;
} }
ret = regcache_init(map); ret = regcache_init(map, config);
if (ret < 0) if (ret < 0)
goto err_map; goto err_map;
......
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