Skip to content

Commit 6626a76

Browse files
pcercueilinusw
authored andcommitted
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: Paul Cercueil <[email protected]> Tested-by: 周琰杰 (Zhou Yanjie)<[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 7261851 commit 6626a76

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/pinctrl/pinctrl-ingenic.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,6 +4149,7 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
41494149
void __iomem *base;
41504150
const struct ingenic_chip_info *chip_info;
41514151
struct device_node *node;
4152+
struct regmap_config regmap_config;
41524153
unsigned int i;
41534154
int err;
41544155

@@ -4166,8 +4167,10 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
41664167
if (IS_ERR(base))
41674168
return PTR_ERR(base);
41684169

4169-
jzpc->map = devm_regmap_init_mmio(dev, base,
4170-
&ingenic_pinctrl_regmap_config);
4170+
regmap_config = ingenic_pinctrl_regmap_config;
4171+
regmap_config.max_register = chip_info->num_chips * chip_info->reg_offset;
4172+
4173+
jzpc->map = devm_regmap_init_mmio(dev, base, &regmap_config);
41714174
if (IS_ERR(jzpc->map)) {
41724175
dev_err(dev, "Failed to create regmap\n");
41734176
return PTR_ERR(jzpc->map);

0 commit comments

Comments
 (0)