Unverified Commit a787ab59 authored by Duje Mihanović's avatar Duje Mihanović Committed by Stephen Boyd
Browse files

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: default avatarDuje Mihanović <duje@dujemihanovic.xyz>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 8f5ae30d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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"
+10 −0
Original line number Diff line number Diff line
# 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.
+4 −1
Original line number Diff line number Diff line
@@ -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
+7 −0
Original line number Diff line number Diff line
// 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);