[PATCH 2/3] mfd: add Airoha GPIO system controller driver
From: John Crispin
Date: Tue Dec 01 2026 - 14:45:40 EST
The GPIO system controller of the AN7589 holds the pin controller and
the PWM controller. The pin controller is a child node. The PWM
controller has no node, so register it as an MFD cell.
Signed-off-by: John Crispin <john@xxxxxxxxxxx>
---
MAINTAINERS | 1 +
drivers/mfd/Kconfig | 11 ++++++++
drivers/mfd/Makefile | 1 +
drivers/mfd/airoha-gpio-sysctl.c | 43 ++++++++++++++++++++++++++++++++
4 files changed, 56 insertions(+)
create mode 100644 drivers/mfd/airoha-gpio-sysctl.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 857ad039c997..196b0be1ab8b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22334,6 +22334,7 @@ S: Maintained
F: Documentation/devicetree/bindings/mfd/airoha,an7589-gpio-sysctl.yaml
F: Documentation/devicetree/bindings/pinctrl/airoha,an7589-pinctrl.yaml
F: Documentation/devicetree/bindings/pinctrl/airoha,en7581-pinctrl.yaml
+F: drivers/mfd/airoha-gpio-sysctl.c
F: drivers/pinctrl/airoha/pinctrl-airoha.c
F: drivers/pinctrl/airoha/pinctrl-an7589.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 81b5cb566996..65afbb32ad16 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -32,6 +32,17 @@ config MFD_ADP5585
the core APIs _only_, you have to select individual components like
the GPIO and PWM functions under the corresponding menus.
+config MFD_AIROHA_GPIO_SYSCTL
+ tristate "Airoha GPIO system controller"
+ select MFD_CORE
+ depends on ARCH_AIROHA || COMPILE_TEST
+ depends on OF
+ help
+ Say yes here to add support for the GPIO system controller of the
+ Airoha AN7589 SoC. The block holds the pin controller and the PWM
+ controller. This driver registers the PWM controller, you have to
+ select the PWM driver under the corresponding menu.
+
config MFD_ALTERA_A10SR
bool "Altera Arria10 DevKit System Resource chip"
depends on ARCH_INTEL_SOCFPGA && SPI_MASTER=y && OF
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 0697f8bbb65f..02e01adbc261 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -200,6 +200,7 @@ obj-$(CONFIG_AB8500_CORE) += ab8500-core.o ab8500-sysctrl.o
obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o
obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
obj-$(CONFIG_MFD_ADP5585) += adp5585.o
+obj-$(CONFIG_MFD_AIROHA_GPIO_SYSCTL) += airoha-gpio-sysctl.o
obj-$(CONFIG_MFD_KEMPLD) += kempld-core.o
obj-$(CONFIG_MFD_INTEL_QUARK_I2C_GPIO) += intel_quark_i2c_gpio.o
obj-$(CONFIG_LPC_SCH) += lpc_sch.o
diff --git a/drivers/mfd/airoha-gpio-sysctl.c b/drivers/mfd/airoha-gpio-sysctl.c
new file mode 100644
index 000000000000..b1cd312dffd9
--- /dev/null
+++ b/drivers/mfd/airoha-gpio-sysctl.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Airoha GPIO system controller
+ *
+ * Copyright (C) 2026 John Crispin <john@xxxxxxxxxxx>
+ */
+
+#include <linux/array_size.h>
+#include <linux/mfd/core.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+static const struct mfd_cell an7589_gpio_sysctl_cells[] = {
+ MFD_CELL_NAME("airoha-an7589-pwm"),
+};
+
+static int airoha_gpio_sysctl_probe(struct platform_device *pdev)
+{
+ return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
+ an7589_gpio_sysctl_cells,
+ ARRAY_SIZE(an7589_gpio_sysctl_cells),
+ NULL, 0, NULL);
+}
+
+static const struct of_device_id airoha_gpio_sysctl_of_match[] = {
+ { .compatible = "airoha,an7589-gpio-sysctl" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, airoha_gpio_sysctl_of_match);
+
+static struct platform_driver airoha_gpio_sysctl_driver = {
+ .probe = airoha_gpio_sysctl_probe,
+ .driver = {
+ .name = "airoha-gpio-sysctl",
+ .of_match_table = airoha_gpio_sysctl_of_match,
+ },
+};
+module_platform_driver(airoha_gpio_sysctl_driver);
+
+MODULE_AUTHOR("John Crispin <john@xxxxxxxxxxx>");
+MODULE_DESCRIPTION("Airoha GPIO system controller driver");
+MODULE_LICENSE("GPL");
--
2.34.1