]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: mmp: pxa1908: Instantiate power driver through auxiliary bus
authorDuje Mihanović <duje@dujemihanovic.xyz>
Sat, 13 Sep 2025 21:12:50 +0000 (23:12 +0200)
committerStephen Boyd <sboyd@kernel.org>
Sun, 21 Sep 2025 17:48:44 +0000 (10:48 -0700)
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@dujemihanovic.xyz>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
MAINTAINERS
drivers/clk/Kconfig
drivers/clk/mmp/Kconfig [new file with mode: 0644]
drivers/clk/mmp/Makefile
drivers/clk/mmp/clk-pxa1908-apmu.c

index fe168477caa45799dfe07de2f54de6d6a1ce0615..860a221af2954572d442b76eae270ebfc8557d74 100644 (file)
@@ -2869,7 +2869,9 @@ ARM/Marvell PXA1908 SOC support
 M:     Duje Mihanović <duje@dujemihanovic.xyz>
 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:     include/dt-bindings/clock/marvell,pxa1908.h
 
index 4d56475f94fc1e28823fe6aee626a96847d4e6d5..68a9641fc649a23013b2d8a9e9f5ecb31d623abb 100644 (file)
@@ -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 (file)
index 0000000..b0d2fea
--- /dev/null
@@ -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.
index 062cd87fa8ddcc6808b6236f8c4dd524aaf02030..0a94f2f0856389c8e959981ccafbb02140a7733d 100644 (file)
@@ -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
index d3a070687fc5b9fb5338f377f82e7664ca0aac29..7594a495a0093e8e22f2cfe3e61a13d23dc3b9c2 100644 (file)
@@ -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,7 @@ 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;
 
        pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
        if (!pxa_unit)
@@ -94,6 +96,11 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
        if (IS_ERR(pxa_unit->base))
                return PTR_ERR(pxa_unit->base);
 
+       adev = devm_auxiliary_device_create(&pdev->dev, "power", NULL);
+       if (IS_ERR(adev))
+               return dev_err_probe(&pdev->dev, PTR_ERR(adev),
+                                    "Failed to register power controller\n");
+
        mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS);
 
        pxa1908_axi_periph_clk_init(pxa_unit);