22 #include <linux/module.h>
24 #include <linux/slab.h>
31 static int regmap_mmio_gather_write(
void *
context,
32 const void *
reg,
size_t reg_size,
33 const void *
val,
size_t val_size)
74 return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4);
77 static int regmap_mmio_read(
void *
context,
78 const void *
reg,
size_t reg_size,
79 void *
val,
size_t val_size)
116 static void regmap_mmio_free_context(
void *context)
121 static struct regmap_bus regmap_mmio = {
123 .write = regmap_mmio_write,
124 .gather_write = regmap_mmio_gather_write,
125 .read = regmap_mmio_read,
126 .free_context = regmap_mmio_free_context,
127 .reg_format_endian_default = REGMAP_ENDIAN_NATIVE,
128 .val_format_endian_default = REGMAP_ENDIAN_NATIVE,
132 const struct regmap_config *
config)
137 if (config->reg_bits != 32)
140 if (config->pad_bits)
143 switch (config->val_bits) {
164 if (config->reg_stride < min_stride)
167 switch (config->reg_format_endian) {
168 case REGMAP_ENDIAN_DEFAULT:
169 case REGMAP_ENDIAN_NATIVE:
197 const struct regmap_config *config)
201 ctx = regmap_mmio_gen_context(regs, config);
203 return ERR_CAST(ctx);
205 return regmap_init(dev, ®map_mmio, ctx, config);
222 const struct regmap_config *config)
226 ctx = regmap_mmio_gen_context(regs, config);
228 return ERR_CAST(ctx);