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