Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: mmp: pxa1908: Instantiate power driver through auxiliary bus

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>

authored by

Duje Mihanović and committed by
Stephen Boyd
a787ab59 8f5ae30d

+24 -1
+2
MAINTAINERS
··· 2869 2869 M: Duje Mihanović <duje@dujemihanovic.xyz> 2870 2870 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2871 2871 S: Maintained 2872 + F: Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml 2872 2873 F: arch/arm64/boot/dts/marvell/mmp/ 2874 + F: drivers/clk/mmp/Kconfig 2873 2875 F: drivers/clk/mmp/clk-pxa1908*.c 2874 2876 F: include/dt-bindings/clock/marvell,pxa1908.h 2875 2877
+1
drivers/clk/Kconfig
··· 511 511 source "drivers/clk/ingenic/Kconfig" 512 512 source "drivers/clk/keystone/Kconfig" 513 513 source "drivers/clk/mediatek/Kconfig" 514 + source "drivers/clk/mmp/Kconfig" 514 515 source "drivers/clk/meson/Kconfig" 515 516 source "drivers/clk/mstar/Kconfig" 516 517 source "drivers/clk/microchip/Kconfig"
+10
drivers/clk/mmp/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + 3 + config COMMON_CLK_PXA1908 4 + bool "Clock driver for Marvell PXA1908" 5 + depends on ARCH_MMP || COMPILE_TEST 6 + depends on OF 7 + default y if ARCH_MMP && ARM64 8 + select AUXILIARY_BUS 9 + help 10 + This driver supports the Marvell PXA1908 SoC clocks.
+4 -1
drivers/clk/mmp/Makefile
··· 11 11 obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o 12 12 obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o 13 13 14 - obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa1908-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o 14 + obj-$(CONFIG_COMMON_CLK_PXA1908) += clk-pxa1908-apbc.o clk-pxa1908-apbcp.o \ 15 + clk-pxa1908-mpmu.o clk-pxa1908-apmu.o 16 + 17 + obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o
+7
drivers/clk/mmp/clk-pxa1908-apmu.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 + #include <linux/auxiliary_bus.h> 2 3 #include <linux/clk-provider.h> 3 4 #include <linux/module.h> 4 5 #include <linux/platform_device.h> ··· 86 85 static int pxa1908_apmu_probe(struct platform_device *pdev) 87 86 { 88 87 struct pxa1908_clk_unit *pxa_unit; 88 + struct auxiliary_device *adev; 89 89 90 90 pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL); 91 91 if (!pxa_unit) ··· 95 93 pxa_unit->base = devm_platform_ioremap_resource(pdev, 0); 96 94 if (IS_ERR(pxa_unit->base)) 97 95 return PTR_ERR(pxa_unit->base); 96 + 97 + adev = devm_auxiliary_device_create(&pdev->dev, "power", NULL); 98 + if (IS_ERR(adev)) 99 + return dev_err_probe(&pdev->dev, PTR_ERR(adev), 100 + "Failed to register power controller\n"); 98 101 99 102 mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS); 100 103