Lines Matching defs:map

16 static int regcache_maple_read(struct regmap *map,
19 struct maple_tree *mt = map->cache;
38 static int regcache_maple_write(struct regmap *map, unsigned int reg,
41 struct maple_tree *mt = map->cache;
77 map->alloc_flags);
95 ret = mas_store_gfp(&mas, entry, map->alloc_flags);
107 static int regcache_maple_drop(struct regmap *map, unsigned int min,
110 struct maple_tree *mt = map->cache;
137 map->alloc_flags);
151 map->alloc_flags);
165 ret = mas_store_gfp(&mas, lower, map->alloc_flags);
173 ret = mas_store_gfp(&mas, upper, map->alloc_flags);
189 static int regcache_maple_sync_block(struct regmap *map, unsigned long *entry,
195 size_t val_bytes = map->format.val_bytes;
206 if (max - min > 1 && regmap_can_raw_write(map)) {
207 buf = kmalloc(val_bytes * (max - min), map->alloc_flags);
215 regcache_set_val(map, buf, r - min,
219 ret = _regmap_raw_write(map, min, buf, (max - min) * val_bytes,
225 ret = _regmap_write(map, r,
238 static int regcache_maple_sync(struct regmap *map, unsigned int min,
241 struct maple_tree *mt = map->cache;
250 map->cache_bypass = true;
258 if (regcache_reg_needs_sync(map, r, v)) {
269 ret = regcache_maple_sync_block(map, entry, &mas,
277 ret = regcache_maple_sync_block(map, entry, &mas,
288 map->cache_bypass = false;
293 static int regcache_maple_exit(struct regmap *map)
295 struct maple_tree *mt = map->cache;
310 map->cache = NULL;
315 static int regcache_maple_insert_block(struct regmap *map, int first,
318 struct maple_tree *mt = map->cache;
323 entry = kcalloc(last - first + 1, sizeof(unsigned long), map->alloc_flags);
328 entry[i] = map->reg_defaults[first + i].def;
332 mas_set_range(&mas, map->reg_defaults[first].reg,
333 map->reg_defaults[last].reg);
334 ret = mas_store_gfp(&mas, entry, map->alloc_flags);
344 static int regcache_maple_init(struct regmap *map)
354 map->cache = mt;
358 if (!map->num_reg_defaults)
364 for (i = 1; i < map->num_reg_defaults; i++) {
365 if (map->reg_defaults[i].reg !=
366 map->reg_defaults[i - 1].reg + 1) {
367 ret = regcache_maple_insert_block(map, range_start,
377 ret = regcache_maple_insert_block(map, range_start,
378 map->num_reg_defaults - 1);
385 regcache_maple_exit(map);