Lines Matching refs:map
23 struct regmap *map; in regmap_alloc_count() local
25 map = malloc(sizeof(struct regmap)); in regmap_alloc_count()
26 if (!map) in regmap_alloc_count()
29 map->range = &map->base_range; in regmap_alloc_count()
31 map->range = malloc(count * sizeof(struct regmap_range)); in regmap_alloc_count()
32 if (!map->range) { in regmap_alloc_count()
33 free(map); in regmap_alloc_count()
37 map->range_count = count; in regmap_alloc_count()
39 return map; in regmap_alloc_count()
47 struct regmap *map; in regmap_init_mem_platdata() local
49 map = regmap_alloc_count(count); in regmap_init_mem_platdata()
50 if (!map) in regmap_init_mem_platdata()
53 map->base = *reg; in regmap_init_mem_platdata()
54 for (range = map->range; count > 0; reg += 2, range++, count--) { in regmap_init_mem_platdata()
59 *mapp = map; in regmap_init_mem_platdata()
67 struct regmap *map; in regmap_init_mem() local
87 map = regmap_alloc_count(count); in regmap_init_mem()
88 if (!map) in regmap_init_mem()
91 for (range = map->range, index = 0; count > 0; in regmap_init_mem()
103 map->base = map->range[0].start; in regmap_init_mem()
105 *mapp = map; in regmap_init_mem()
111 void *regmap_get_range(struct regmap *map, unsigned int range_num) in regmap_get_range() argument
115 if (range_num >= map->range_count) in regmap_get_range()
117 range = &map->range[range_num]; in regmap_get_range()
122 int regmap_uninit(struct regmap *map) in regmap_uninit() argument
124 if (map->range_count > 1) in regmap_uninit()
125 free(map->range); in regmap_uninit()
126 free(map); in regmap_uninit()
131 int regmap_read(struct regmap *map, uint offset, uint *valp) in regmap_read() argument
133 uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE); in regmap_read()
140 int regmap_write(struct regmap *map, uint offset, uint val) in regmap_write() argument
142 uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE); in regmap_write()
149 int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val) in regmap_update_bits() argument
154 ret = regmap_read(map, offset, ®); in regmap_update_bits()
160 return regmap_write(map, offset, reg | val); in regmap_update_bits()