[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFpcCCUi4nKNmvvtnXs1OdUz3aHK7G+Jbi9LzLt=o=+QTQ@mail.gmail.com>
Date: Thu, 11 Sep 2025 16:35:13 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Duje Mihanović <duje@...emihanovic.xyz>
Cc: Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
David Wronek <david@...nlining.org>, Karel Balej <balejk@...fyz.cz>, phone-devel@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht, linux-arm-kernel@...ts.infradead.org,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 3/4] clk: mmp: pxa1908: Instantiate power driver
through auxiliary bus
On Fri, 29 Aug 2025 at 18:22, Duje Mihanović <duje@...emihanovic.xyz> wrote:
>
> 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ć <duje@...emihanovic.xyz>
> ---
> 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..88c0df09d7b354f95864f5a48daea3be14a90dc4 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2869,7 +2869,9 @@ ARM/Marvell PXA1908 SOC support
> M: Duje Mihanović <duje@...emihanovic.xyz>
> L: linux-arm-kernel@...ts.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..68a9641fc649a23013b2d8a9e9f5ecb31d623abb 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..b0d2fea3cda5de1284916ab75d3af0412edcf57f
> --- /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..0a94f2f0856389c8e959981ccafbb02140a7733d 100644
> --- a/drivers/clk/mmp/Makefile
> +++ b/drivers/clk/mmp/Makefile
> @@ -11,4 +11,7 @@ obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
> obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o
> obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o
>
> -obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa1908-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o
> +obj-$(CONFIG_COMMON_CLK_PXA1908) += clk-pxa1908-apbc.o clk-pxa1908-apbcp.o \
> + clk-pxa1908-mpmu.o clk-pxa1908-apmu.o
> +
> +obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o
> diff --git a/drivers/clk/mmp/clk-pxa1908-apmu.c b/drivers/clk/mmp/clk-pxa1908-apmu.c
> index d3a070687fc5b9fb5338f377f82e7664ca0aac29..eab02c89c9153619ac53f7486ed811f2cae12a43 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 <linux/auxiliary_bus.h>
> #include <linux/clk-provider.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> @@ -85,6 +86,8 @@ static void pxa1908_axi_periph_clk_init(struct pxa1908_clk_unit *pxa_unit)
> static int pxa1908_apmu_probe(struct platform_device *pdev)
> {
> struct pxa1908_clk_unit *pxa_unit;
> + struct auxiliary_device *adev;
> + int ret;
>
> pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
> if (!pxa_unit)
> @@ -94,6 +97,23 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
> if (IS_ERR(pxa_unit->base))
> return PTR_ERR(pxa_unit->base);
>
> + adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
> + if (!adev)
> + return -ENOMEM;
> +
> + adev->name = "power";
> + adev->dev.parent = &pdev->dev;
> +
> + ret = auxiliary_device_init(adev);
> + if (ret)
> + return ret;
> +
> + ret = auxiliary_device_add(adev);
> + if (ret) {
> + auxiliary_device_uninit(adev);
> + return ret;
> + }
> +
I think the above can be simplified with devm_auxiliary_device_create().
> mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS);
>
> pxa1908_axi_periph_clk_init(pxa_unit);
>
> --
> 2.51.0
>
Kind regards
Uffe
Powered by blists - more mailing lists