Commit 6626a76e authored by Paul Cercueil's avatar Paul Cercueil Committed by Linus Walleij

pinctrl: ingenic: Add .max_register in regmap_config

Compute the max register from the GPIO chip offset and number of GPIO
chips.

This permits to read all registers from debugfs.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Tested-by: 周琰杰 (Zhou Yanjie)<zhouyanjie@wanyeetech.com>
Link: https://lore.kernel.org/r/20210717174836.14776-3-paul@crapouillou.netSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7261851e
......@@ -4149,6 +4149,7 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
void __iomem *base;
const struct ingenic_chip_info *chip_info;
struct device_node *node;
struct regmap_config regmap_config;
unsigned int i;
int err;
......@@ -4166,8 +4167,10 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
jzpc->map = devm_regmap_init_mmio(dev, base,
&ingenic_pinctrl_regmap_config);
regmap_config = ingenic_pinctrl_regmap_config;
regmap_config.max_register = chip_info->num_chips * chip_info->reg_offset;
jzpc->map = devm_regmap_init_mmio(dev, base, &regmap_config);
if (IS_ERR(jzpc->map)) {
dev_err(dev, "Failed to create regmap\n");
return PTR_ERR(jzpc->map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment