Lines Matching refs:map
19 static inline unsigned int regcache_flat_get_index(const struct regmap *map, in regcache_flat_get_index() argument
22 return regcache_get_index_by_order(map, reg); in regcache_flat_get_index()
30 static int regcache_flat_init(struct regmap *map) in regcache_flat_init() argument
35 if (!map || map->reg_stride_order < 0 || !map->max_register_is_set) in regcache_flat_init()
38 cache_size = regcache_flat_get_index(map, map->max_register) + 1; in regcache_flat_init()
39 cache = kzalloc_flex(*cache, data, cache_size, map->alloc_flags); in regcache_flat_init()
43 cache->valid = bitmap_zalloc(cache_size, map->alloc_flags); in regcache_flat_init()
47 map->cache = cache; in regcache_flat_init()
56 static int regcache_flat_exit(struct regmap *map) in regcache_flat_exit() argument
58 struct regcache_flat_data *cache = map->cache; in regcache_flat_exit()
64 map->cache = NULL; in regcache_flat_exit()
69 static int regcache_flat_populate(struct regmap *map) in regcache_flat_populate() argument
71 struct regcache_flat_data *cache = map->cache; in regcache_flat_populate()
74 for (i = 0; i < map->num_reg_defaults; i++) { in regcache_flat_populate()
75 unsigned int reg = map->reg_defaults[i].reg; in regcache_flat_populate()
76 unsigned int index = regcache_flat_get_index(map, reg); in regcache_flat_populate()
78 cache->data[index] = map->reg_defaults[i].def; in regcache_flat_populate()
82 if (map->reg_default_cb) { in regcache_flat_populate()
83 dev_dbg(map->dev, in regcache_flat_populate()
86 for (i = 0; i <= map->max_register; i += map->reg_stride) { in regcache_flat_populate()
87 unsigned int index = regcache_flat_get_index(map, i); in regcache_flat_populate()
93 if (map->reg_default_cb(map->dev, i, &value)) in regcache_flat_populate()
104 static int regcache_flat_read(struct regmap *map, in regcache_flat_read() argument
107 struct regcache_flat_data *cache = map->cache; in regcache_flat_read()
108 unsigned int index = regcache_flat_get_index(map, reg); in regcache_flat_read()
112 dev_warn_once(map->dev, in regcache_flat_read()
120 static int regcache_flat_sparse_read(struct regmap *map, in regcache_flat_sparse_read() argument
123 struct regcache_flat_data *cache = map->cache; in regcache_flat_sparse_read()
124 unsigned int index = regcache_flat_get_index(map, reg); in regcache_flat_sparse_read()
134 static int regcache_flat_write(struct regmap *map, unsigned int reg, in regcache_flat_write() argument
137 struct regcache_flat_data *cache = map->cache; in regcache_flat_write()
138 unsigned int index = regcache_flat_get_index(map, reg); in regcache_flat_write()
146 static int regcache_flat_drop(struct regmap *map, unsigned int min, in regcache_flat_drop() argument
149 struct regcache_flat_data *cache = map->cache; in regcache_flat_drop()
150 unsigned int bitmap_min = regcache_flat_get_index(map, min); in regcache_flat_drop()
151 unsigned int bitmap_max = regcache_flat_get_index(map, max); in regcache_flat_drop()