Skip to content

Commit a787ab5

Browse files
LegoLivesMatterbebarino
authored andcommitted
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>
1 parent 8f5ae30 commit a787ab5

5 files changed

Lines changed: 24 additions & 1 deletion

File tree

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,7 +2869,9 @@ ARM/Marvell PXA1908 SOC support
28692869
M: Duje Mihanović <duje@dujemihanovic.xyz>
28702870
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
28712871
S: Maintained
2872+
F: Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
28722873
F: arch/arm64/boot/dts/marvell/mmp/
2874+
F: drivers/clk/mmp/Kconfig
28732875
F: drivers/clk/mmp/clk-pxa1908*.c
28742876
F: include/dt-bindings/clock/marvell,pxa1908.h
28752877

drivers/clk/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ source "drivers/clk/imx/Kconfig"
511511
source "drivers/clk/ingenic/Kconfig"
512512
source "drivers/clk/keystone/Kconfig"
513513
source "drivers/clk/mediatek/Kconfig"
514+
source "drivers/clk/mmp/Kconfig"
514515
source "drivers/clk/meson/Kconfig"
515516
source "drivers/clk/mstar/Kconfig"
516517
source "drivers/clk/microchip/Kconfig"

drivers/clk/mmp/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.

drivers/clk/mmp/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
1111
obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o
1212
obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o
1313

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

drivers/clk/mmp/clk-pxa1908-apmu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
#include <linux/auxiliary_bus.h>
23
#include <linux/clk-provider.h>
34
#include <linux/module.h>
45
#include <linux/platform_device.h>
@@ -85,6 +86,7 @@ static void pxa1908_axi_periph_clk_init(struct pxa1908_clk_unit *pxa_unit)
8586
static int pxa1908_apmu_probe(struct platform_device *pdev)
8687
{
8788
struct pxa1908_clk_unit *pxa_unit;
89+
struct auxiliary_device *adev;
8890

8991
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
9092
if (!pxa_unit)
@@ -94,6 +96,11 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
9496
if (IS_ERR(pxa_unit->base))
9597
return PTR_ERR(pxa_unit->base);
9698

99+
adev = devm_auxiliary_device_create(&pdev->dev, "power", NULL);
100+
if (IS_ERR(adev))
101+
return dev_err_probe(&pdev->dev, PTR_ERR(adev),
102+
"Failed to register power controller\n");
103+
97104
mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS);
98105

99106
pxa1908_axi_periph_clk_init(pxa_unit);

0 commit comments

Comments
 (0)