[PATCH] gpio: mvebu: name regmaps to fix debugfs collisions
From: Rosen Penev
Date: Fri Sep 04 2026 - 20:45:53 EST
Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm'
register windows, and the driver creates one regmap per window on the
same platform device. The shared regmap_config was unnamed, so both
maps defaulted their debugfs directory to dev_name(), e.g.
debugfs: 'f1018100.gpio' already exists in 'regmap'
because the PWM regmap (and on Armada XP the per-CPU regmap) claimed
the same directory as the GPIO regmap.
Give each regmap a distinct .name so the debugfs directories become
'<dev>.gpio', '<dev>.percpu' and '<dev>.pwm'. This only affects
debugfs naming; register access is unchanged.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/gpio/gpio-mvebu.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 93b8a08b04b9..c57758019e92 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -599,6 +599,21 @@ static void mvebu_gpio_irq_handler(struct irq_desc *desc)
}
static const struct regmap_config mvebu_gpio_regmap_config = {
+ .name = "gpio",
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+};
+
+static const struct regmap_config mvebu_gpio_percpu_regmap_config = {
+ .name = "percpu",
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+};
+
+static const struct regmap_config mvebu_pwm_regmap_config = {
+ .name = "pwm",
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
@@ -868,7 +883,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
return PTR_ERR(base);
mvpwm->regs = devm_regmap_init_mmio(&pdev->dev, base,
- &mvebu_gpio_regmap_config);
+ &mvebu_pwm_regmap_config);
if (IS_ERR(mvpwm->regs))
return PTR_ERR(mvpwm->regs);
@@ -1114,7 +1129,7 @@ static int mvebu_gpio_probe_raw(struct platform_device *pdev,
mvchip->percpu_regs =
devm_regmap_init_mmio(&pdev->dev, base,
- &mvebu_gpio_regmap_config);
+ &mvebu_gpio_percpu_regmap_config);
if (IS_ERR(mvchip->percpu_regs))
return PTR_ERR(mvchip->percpu_regs);
}
--
2.55.0