Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280543
b: refs/heads/master
c: e5e3b8a
h: refs/heads/master
i:
  280541: 90e4c5b
  280539: d0e7990
  280535: fe23510
  280527: b0a3f7b
  280511: 980febf
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 16, 2011
1 parent a565bc1 commit 5dd07a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2b1ecd13c6a7b19f1c0c48b68f61ab083f3ec3f
refs/heads/master: e5e3b8abeda1cf45f5a079458dbc267952694c7a
2 changes: 1 addition & 1 deletion trunk/drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int regcache_hw_init(struct regmap *map)
return ret;
}

int regcache_init(struct regmap *map)
int regcache_init(struct regmap *map, const struct regmap_config *config)
{
int ret;
int i;
Expand All @@ -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];

Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,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;
Expand Down Expand Up @@ -227,7 +221,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_free_workbuf;

Expand Down

0 comments on commit 5dd07a2

Please sign in to comment.