Lines Matching refs:map
15 static inline unsigned int regcache_flat_get_index(const struct regmap *map,
18 return regcache_get_index_by_order(map, reg);
21 static int regcache_flat_init(struct regmap *map)
26 if (!map || map->reg_stride_order < 0 || !map->max_register_is_set)
29 map->cache = kcalloc(regcache_flat_get_index(map, map->max_register)
31 if (!map->cache)
34 cache = map->cache;
36 for (i = 0; i < map->num_reg_defaults; i++) {
37 unsigned int reg = map->reg_defaults[i].reg;
38 unsigned int index = regcache_flat_get_index(map, reg);
40 cache[index] = map->reg_defaults[i].def;
46 static int regcache_flat_exit(struct regmap *map)
48 kfree(map->cache);
49 map->cache = NULL;
54 static int regcache_flat_read(struct regmap *map,
57 unsigned int *cache = map->cache;
58 unsigned int index = regcache_flat_get_index(map, reg);
65 static int regcache_flat_write(struct regmap *map, unsigned int reg,
68 unsigned int *cache = map->cache;
69 unsigned int index = regcache_flat_get_index(map, reg);