Reputation: 1529
I would like to know, how devm_regmap_init_mmio() can be used to export a regmap for 16 bytes (span over two subregions). For instance, from one of the driver in Linux:
regs = devm_platform_ioremap_resource_byname(pdev, "ehb");
if (IS_ERR(regs)) {
dev_err(apb->dev, "Couldn't map APB EHB registers\n");
return PTR_ERR(regs);
}
apb->regs = devm_regmap_init_mmio(apb->dev, regs, &bt1_apb_regmap_cfg);
if (IS_ERR(apb->regs)) {
dev_err(apb->dev, "Couldn't create APB EHB regmap\n");
return PTR_ERR(apb->regs);
' with bt1_apb_regmap_cfg filled as
static const struct regmap_config bt1_apb_regmap_cfg = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.max_register = APB_EHB_TIMEOUT,
.fast_io = true
};
here looks like whole register range is exported using devm_regmap_init_mmio but is there a way to export only 16 byters span across four register ?
Also, what are these fields .max_register and .reg_stride means here ?
Upvotes: 0
Views: 768
Reputation: 477
max_register means if the register range is from 0x1000 to 0x1040 than than max_register = 0x40
reg_stride means the register address should be multiple of this value
Upvotes: 1