Lines Matching refs:map

51 	struct regmap *map;  in regmap_alloc()  local
52 size_t size = sizeof(*map) + sizeof(map->ranges[0]) * count; in regmap_alloc()
54 map = calloc(1, size); in regmap_alloc()
55 if (!map) in regmap_alloc()
57 map->range_count = count; in regmap_alloc()
58 map->width = REGMAP_SIZE_32; in regmap_alloc()
60 return map; in regmap_alloc()
68 struct regmap *map; in regmap_init_mem_plat() local
70 map = regmap_alloc(count); in regmap_init_mem_plat()
71 if (!map) in regmap_init_mem_plat()
74 for (range = map->ranges; count > 0; reg += 2, range++, count--) { in regmap_init_mem_plat()
79 *mapp = map; in regmap_init_mem_plat()
138 struct regmap *map; in regmap_init_mem_index() local
156 map = regmap_alloc(1); in regmap_init_mem_index()
157 if (!map) in regmap_init_mem_index()
160 ret = init_range(node, map->ranges, addr_len, size_len, index); in regmap_init_mem_index()
165 map->endianness = REGMAP_LITTLE_ENDIAN; in regmap_init_mem_index()
167 map->endianness = REGMAP_BIG_ENDIAN; in regmap_init_mem_index()
169 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem_index()
171 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem_index()
173 *mapp = map; in regmap_init_mem_index()
177 regmap_uninit(map); in regmap_init_mem_index()
185 struct regmap *map; in regmap_init_mem_range() local
188 map = regmap_alloc(1); in regmap_init_mem_range()
189 if (!map) in regmap_init_mem_range()
192 range = &map->ranges[0]; in regmap_init_mem_range()
197 map->endianness = REGMAP_LITTLE_ENDIAN; in regmap_init_mem_range()
199 map->endianness = REGMAP_BIG_ENDIAN; in regmap_init_mem_range()
201 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem_range()
203 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem_range()
205 *mapp = map; in regmap_init_mem_range()
212 struct regmap *map; in regmap_init_mem() local
254 map = regmap_alloc(count); in regmap_init_mem()
255 if (!map) in regmap_init_mem()
258 for (range = map->ranges, index = 0; count > 0; in regmap_init_mem()
266 map->endianness = REGMAP_LITTLE_ENDIAN; in regmap_init_mem()
268 map->endianness = REGMAP_BIG_ENDIAN; in regmap_init_mem()
270 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem()
272 map->endianness = REGMAP_NATIVE_ENDIAN; in regmap_init_mem()
274 *mapp = map; in regmap_init_mem()
278 regmap_uninit(map); in regmap_init_mem()
294 struct regmap **mapp, *map; in devm_regmap_init() local
309 map = *mapp; in devm_regmap_init()
311 map->width = config->width; in devm_regmap_init()
312 map->reg_offset_shift = config->reg_offset_shift; in devm_regmap_init()
320 void *regmap_get_range(struct regmap *map, unsigned int range_num) in regmap_get_range() argument
324 if (range_num >= map->range_count) in regmap_get_range()
326 range = &map->ranges[range_num]; in regmap_get_range()
331 int regmap_uninit(struct regmap *map) in regmap_uninit() argument
333 free(map); in regmap_uninit()
387 int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset, in regmap_raw_read_range() argument
393 if (range_num >= map->range_count) { in regmap_raw_read_range()
398 range = &map->ranges[range_num]; in regmap_raw_read_range()
400 offset <<= map->reg_offset_shift; in regmap_raw_read_range()
410 *((u8 *)valp) = __read_8(ptr, map->endianness); in regmap_raw_read_range()
413 *((u16 *)valp) = __read_16(ptr, map->endianness); in regmap_raw_read_range()
416 *((u32 *)valp) = __read_32(ptr, map->endianness); in regmap_raw_read_range()
420 *((u64 *)valp) = __read_64(ptr, map->endianness); in regmap_raw_read_range()
431 int regmap_raw_read(struct regmap *map, uint offset, void *valp, size_t val_len) in regmap_raw_read() argument
433 return regmap_raw_read_range(map, 0, offset, valp, val_len); in regmap_raw_read()
436 int regmap_read(struct regmap *map, uint offset, uint *valp) in regmap_read() argument
438 return regmap_raw_read(map, offset, valp, map->width); in regmap_read()
497 int regmap_raw_write_range(struct regmap *map, uint range_num, uint offset, in regmap_raw_write_range() argument
503 if (range_num >= map->range_count) { in regmap_raw_write_range()
508 range = &map->ranges[range_num]; in regmap_raw_write_range()
510 offset <<= map->reg_offset_shift; in regmap_raw_write_range()
520 __write_8(ptr, val, map->endianness); in regmap_raw_write_range()
523 __write_16(ptr, val, map->endianness); in regmap_raw_write_range()
526 __write_32(ptr, val, map->endianness); in regmap_raw_write_range()
530 __write_64(ptr, val, map->endianness); in regmap_raw_write_range()
541 int regmap_raw_write(struct regmap *map, uint offset, const void *val, in regmap_raw_write() argument
544 return regmap_raw_write_range(map, 0, offset, val, val_len); in regmap_raw_write()
547 int regmap_write(struct regmap *map, uint offset, uint val) in regmap_write() argument
549 return regmap_raw_write(map, offset, &val, map->width); in regmap_write()
552 int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val) in regmap_update_bits() argument
557 ret = regmap_read(map, offset, &reg); in regmap_update_bits()
563 return regmap_write(map, offset, reg | (val & mask)); in regmap_update_bits()