From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=46.4.11.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796154292; b=dDA529jWoJlNL7RFd8jzs3SlTTJ4BnyNyqfsfEPcx4Xrzf1OLRGbtYGxPCCAx3r7aDQZ h32PHwPLuFCsvF5sSOTBsFbhpfPWePA5Yk01k1iQcRmrdSVADm3WF+e8cC+6RXcLD901/ wAHIBoGQl7CtEbKLynS5QMtacLETXUWojcoLBRzIV9SG/rGTnd/bZHtbqVFvGUnFUcOGo yXWBXZwto5S14f6jvWI7hcDAtWZgiuxGgQn6o4KNZpxNTNPaSGI0t1o1DAV0jdeyg1wuz 3Tsmjy4LjnbVolYXsmc4s6aY71TxBMVPAGCKgH8Eexj2QTl0PmFOQiaEivfJbgkCkpQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796154292; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=ol5GmfGgvsZxWsSJNO5Uoo1W3yhTx5Bf8ZmOXu4rCkY=; b=5B06s/hYJQBvIXOjPLCjl+KIfSYzymQco+O+pfeYGHo28Y8lsWb+EawdayNCHffA1lLw hHIMjMjLcqioe5E6kW1uRsDXCMx7gvk2KN0LThhdwM0MDcbSfNaiRPwKUHRYzE6LI6E2c IN4m+yNnQ0/HvVXfkHFR8+KRa2W4uNcczNOyVYDfoXCvSmKgKCN7wtR0mAh/E9A5zUkbi YAOcw7Pa2L2lUa3UwMKZShEaQnGmCsZJEwUNpaZhCt6kT5aBKACem6yiTlYGY3D6a1/Yo SJlg7dqDftH+57N0iwpUbNqqRBpbpRdVYbt6+U8gu/t6q2c8Nq4KplYicx/9D82YM/A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=phrozen.org; spf=pass smtp.mailfrom=phrozen.org; arc=none smtp.remote-ip=46.4.11.11 Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69C85606A68F; Tue, 1 Dec 2026 19:44:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 69C85606A68F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phrozen.org Received: from [2a04:4540:1405:15fc:bd72:1c73:6cc3:2cda] (helo=bertha10..) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xYTmN-00AtKQ-2z; Tue, 01 Dec 2026 20:44:43 +0100 From: John Crispin To: Lorenzo Bianconi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: Christian Marangi , devicetree@vger.kernel.org, lei.dong@airoha.com, Linqi.zhang@airoha.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org, mfd@lists.linux.dev, Rajeev.kumar@airoha.com, upstream@airoha.com, Weifeng.xu@airoha.com, zhengping.zhang@airoha.com Subject: [PATCH 2/3] mfd: add Airoha GPIO system controller driver Date: Tue, 1 Dec 2026 20:44:33 +0100 Message-Id: <20261201194434.3132187-3-john@phrozen.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261201194434.3132187-1-john@phrozen.org> References: <20261201194434.3132187-1-john@phrozen.org> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 + */ + +#include +#include +#include +#include +#include + +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 "); +MODULE_DESCRIPTION("Airoha GPIO system controller driver"); +MODULE_LICENSE("GPL"); -- 2.34.1