From nobody Fri Oct 3 15:32:46 2025 Received: from mx.olsak.net (mx.olsak.net [37.205.8.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44D41322DAA; Fri, 29 Aug 2025 16:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.205.8.231 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756484555; cv=none; b=mZ/LY6SnTUpGhMB1kc08TEVeugWdd39AL9GdiJGn7s4IYbN1Js72yMv03QqVBdbonDjw3udzbi9/Q8q5TM7sh1GkGF24jRgCBf4U//uRGT8xNFCRq7dyUSQseAq8h7DeOmQxU5Y3XeIghFb6yMRgezUHVbhSKzlbHsNywjw11qE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756484555; c=relaxed/simple; bh=fPWhnGfubtatcWiWaKaUiAvygdrfiV2pPKAKsw2j7KQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iJZbwQcZ4EZWpYyUEoQRFOL21fwxT+Zz5z7ZeCF25AKkMG4UtAuFMsr3+68NB0sxPJ81vUKmx4D7AMNEqFTW2Rr4qgNA5MUIbUfWZO8ekfVr8yFRl31KxOYUPYdGCp7MUEMzBX0XmT9rHjQxQTreHN5jF5q2p29K41jFlPIyDv4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=dujemihanovic.xyz; spf=pass smtp.mailfrom=dujemihanovic.xyz; dkim=pass (2048-bit key) header.d=dujemihanovic.xyz header.i=@dujemihanovic.xyz header.b=MOSA6oI9; arc=none smtp.client-ip=37.205.8.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=dujemihanovic.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dujemihanovic.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dujemihanovic.xyz header.i=@dujemihanovic.xyz header.b="MOSA6oI9" DKIM-Signature: a=rsa-sha256; bh=MLQLlNtnOCPhjt4e0xOfXJp9xP7cfZoVEkC3zGk+ocg=; c=relaxed/relaxed; d=dujemihanovic.xyz; h=Subject:Subject:Sender:To:To:Cc:Cc:From:From:Date:Date:MIME-Version:MIME-Version:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Reply-To:In-Reply-To:In-Reply-To:Message-Id:Message-Id:References:References:Autocrypt:Openpgp; i=@dujemihanovic.xyz; s=default; t=1756484471; v=1; x=1756916471; b=MOSA6oI9LJFmMEejE0ziCE7DsKyPiauy9MpmVkwn2PfO0U2Zp1ttR9wV7MR+dJ13kzURd2pi 0nq3GVkfRKllmzxnQF3MshjajU56vBuiRc28Ia9BEojtgAcRmMHFFwX5myr2anTjwsL41mkB1xU VjrJrra4O7YzmyzYhpmRjFzdmii1VjYF0ngG5FcinpsYubfIcj+UJyuQNcPSv0Tos1lVyzPtPQW q01RFFeRs/CbdPGmIMreVMmf+uiViSFLyBDiXJWFMfnU3W2yNSY6cVO4K+GV1S2bNqkvSaz7rkw ekHOBLf9FEg/eUBuhg2HrVt2jgSO3Cfi3Xw+MzwvgtjQw== Received: by mx.olsak.net (envelope-sender ) with ESMTPS id 9fa50dd1; Fri, 29 Aug 2025 18:21:11 +0200 From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Fri, 29 Aug 2025 18:21:06 +0200 Subject: [PATCH v3 3/4] clk: mmp: pxa1908: Instantiate power driver through auxiliary bus Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-pxa1908-genpd-v3-3-2aacaaaca271@dujemihanovic.xyz> References: <20250829-pxa1908-genpd-v3-0-2aacaaaca271@dujemihanovic.xyz> In-Reply-To: <20250829-pxa1908-genpd-v3-0-2aacaaaca271@dujemihanovic.xyz> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson Cc: David Wronek , Karel Balej , phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Duje_Mihanovi=C4=87?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4741; i=duje@dujemihanovic.xyz; s=20240706; h=from:subject:message-id; bh=fPWhnGfubtatcWiWaKaUiAvygdrfiV2pPKAKsw2j7KQ=; b=owGbwMvMwCW21nBykGv/WmbG02pJDBkbLxdvXb7nS5z1mZKHJ1aditrhwrsyem+jm9rzC6bf2 I+sKlh7sKOUhUGMi0FWTJEl97/jNd7PIlu3Zy8zgJnDygQyhIGLUwAmUj2L4X+F6hMd9trLAfNr p1w4umFW1YtdqwqOfvoRay2koVHjmfqO4X9K9YwKv4c3Fs6e3ZdYfkPtebZGK//+gn89V39xvpt 1cDEHAA== X-Developer-Key: i=duje@dujemihanovic.xyz; a=openpgp; fpr=6DFF41D60DF314B5B76BA630AD319352458FAD03 The power domain driver shares the APMU clock controller's registers. Instantiate the power domain driver through the APMU clock driver using the auxiliary bus. Also create a separate Kconfig entry for the PXA1908 clock driver to allow (de)selecting the driver at will and selecting CONFIG_AUXILIARY_BUS. Signed-off-by: Duje Mihanovi=C4=87 --- v3: - Move driver back to pmdomain subsystem, use auxiliary bus to instantiate the driver v2: - Move to clk subsystem, instantiate the driver from the APMU clock driver - Drop clock handling - Squash MAINTAINERS patch --- MAINTAINERS | 2 ++ drivers/clk/Kconfig | 1 + drivers/clk/mmp/Kconfig | 10 ++++++++++ drivers/clk/mmp/Makefile | 5 ++++- drivers/clk/mmp/clk-pxa1908-apmu.c | 20 ++++++++++++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 34e5e218e83e0ed9882b111f5251601dd6549d4e..88c0df09d7b354f95864f5a48da= ea3be14a90dc4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2869,7 +2869,9 @@ ARM/Marvell PXA1908 SOC support M: Duje Mihanovi=C4=87 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained +F: Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml F: arch/arm64/boot/dts/marvell/mmp/ +F: drivers/clk/mmp/Kconfig F: drivers/clk/mmp/clk-pxa1908*.c F: drivers/pmdomain/marvell/ F: include/dt-bindings/clock/marvell,pxa1908.h diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 4d56475f94fc1e28823fe6aee626a96847d4e6d5..68a9641fc649a23013b2d8a9e9f= 5ecb31d623abb 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -511,6 +511,7 @@ source "drivers/clk/imx/Kconfig" source "drivers/clk/ingenic/Kconfig" source "drivers/clk/keystone/Kconfig" source "drivers/clk/mediatek/Kconfig" +source "drivers/clk/mmp/Kconfig" source "drivers/clk/meson/Kconfig" source "drivers/clk/mstar/Kconfig" source "drivers/clk/microchip/Kconfig" diff --git a/drivers/clk/mmp/Kconfig b/drivers/clk/mmp/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..b0d2fea3cda5de1284916ab75d3= af0412edcf57f --- /dev/null +++ b/drivers/clk/mmp/Kconfig @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config COMMON_CLK_PXA1908 + bool "Clock driver for Marvell PXA1908" + depends on ARCH_MMP || COMPILE_TEST + depends on OF + default y if ARCH_MMP && ARM64 + select AUXILIARY_BUS + help + This driver supports the Marvell PXA1908 SoC clocks. diff --git a/drivers/clk/mmp/Makefile b/drivers/clk/mmp/Makefile index 062cd87fa8ddcc6808b6236f8c4dd524aaf02030..0a94f2f0856389c8e959981ccaf= bb02140a7733d 100644 --- a/drivers/clk/mmp/Makefile +++ b/drivers/clk/mmp/Makefile @@ -11,4 +11,7 @@ obj-$(CONFIG_MACH_MMP_DT) +=3D clk-of-pxa168.o clk-of-pxa= 910.o obj-$(CONFIG_COMMON_CLK_MMP2) +=3D clk-of-mmp2.o clk-pll.o pwr-island.o obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) +=3D clk-audio.o =20 -obj-$(CONFIG_ARCH_MMP) +=3D clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa190= 8-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o +obj-$(CONFIG_COMMON_CLK_PXA1908) +=3D clk-pxa1908-apbc.o clk-pxa1908-apbcp= .o \ + clk-pxa1908-mpmu.o clk-pxa1908-apmu.o + +obj-$(CONFIG_ARCH_MMP) +=3D clk-of-pxa1928.o diff --git a/drivers/clk/mmp/clk-pxa1908-apmu.c b/drivers/clk/mmp/clk-pxa19= 08-apmu.c index d3a070687fc5b9fb5338f377f82e7664ca0aac29..eab02c89c9153619ac53f7486ed= 811f2cae12a43 100644 --- a/drivers/clk/mmp/clk-pxa1908-apmu.c +++ b/drivers/clk/mmp/clk-pxa1908-apmu.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only +#include #include #include #include @@ -85,6 +86,8 @@ static void pxa1908_axi_periph_clk_init(struct pxa1908_cl= k_unit *pxa_unit) static int pxa1908_apmu_probe(struct platform_device *pdev) { struct pxa1908_clk_unit *pxa_unit; + struct auxiliary_device *adev; + int ret; =20 pxa_unit =3D devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL); if (!pxa_unit) @@ -94,6 +97,23 @@ static int pxa1908_apmu_probe(struct platform_device *pd= ev) if (IS_ERR(pxa_unit->base)) return PTR_ERR(pxa_unit->base); =20 + adev =3D devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL); + if (!adev) + return -ENOMEM; + + adev->name =3D "power"; + adev->dev.parent =3D &pdev->dev; + + ret =3D auxiliary_device_init(adev); + if (ret) + return ret; + + ret =3D auxiliary_device_add(adev); + if (ret) { + auxiliary_device_uninit(adev); + return ret; + } + mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS); =20 pxa1908_axi_periph_clk_init(pxa_unit); --=20 2.51.0