12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef __REGMAP_H
- #define __REGMAP_H
- struct regmap_range {
- ulong start;
- ulong size;
- };
- struct regmap {
- phys_addr_t base;
- int range_count;
- struct regmap_range *range, base_range;
- };
- int regmap_write(struct regmap *map, uint offset, uint val);
- int regmap_read(struct regmap *map, uint offset, uint *valp);
- #define regmap_write32(map, ptr, member, val) \
- regmap_write(map, (uint32_t *)(ptr)->member - (uint32_t *)(ptr), val)
- #define regmap_read32(map, ptr, member, valp) \
- regmap_read(map, (uint32_t *)(ptr)->member - (uint32_t *)(ptr), valp)
- int regmap_init_mem(struct udevice *dev, struct regmap **mapp);
- int regmap_init_mem_platdata(struct udevice *dev, u32 *reg, int count,
- struct regmap **mapp);
- void *regmap_get_range(struct regmap *map, unsigned int range_num);
- int regmap_uninit(struct regmap *map);
- #endif
|