[Patch v4 05/10] clk: lpc32xx: initialize regmap using parent syscon
Piotr Wojtaszczyk
piotr.wojtaszczyk at timesys.com
Thu Jun 20 10:56:36 PDT 2024
This allows to share the regmap with other simple-mfd devices like
nxp,lpc32xx-dmamux
Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk at timesys.com>
---
Changes for v4:
- This patch is new in v4
drivers/clk/Kconfig | 1 +
drivers/clk/nxp/clk-lpc32xx.c | 10 ++--------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 3e9099504fad..85ef57d5cccf 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -346,6 +346,7 @@ config COMMON_CLK_LOONGSON2
config COMMON_CLK_NXP
def_bool COMMON_CLK && (ARCH_LPC18XX || ARCH_LPC32XX)
select REGMAP_MMIO if ARCH_LPC32XX
+ select MFD_SYSCON if ARCH_LPC32XX
select MFD_SYSCON if ARCH_LPC18XX
help
Support for clock providers on NXP platforms.
diff --git a/drivers/clk/nxp/clk-lpc32xx.c b/drivers/clk/nxp/clk-lpc32xx.c
index d0f870eff0d6..2a183a9ded93 100644
--- a/drivers/clk/nxp/clk-lpc32xx.c
+++ b/drivers/clk/nxp/clk-lpc32xx.c
@@ -7,6 +7,7 @@
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/of_address.h>
+#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/lpc32xx-clock.h>
@@ -1511,17 +1512,10 @@ static void __init lpc32xx_clk_init(struct device_node *np)
return;
}
- base = of_iomap(np, 0);
- if (!base) {
- pr_err("failed to map system control block registers\n");
- return;
- }
-
- clk_regmap = regmap_init_mmio(NULL, base, &lpc32xx_scb_regmap_config);
+ clk_regmap = syscon_node_to_regmap(np->parent);
if (IS_ERR(clk_regmap)) {
pr_err("failed to regmap system control block: %ld\n",
PTR_ERR(clk_regmap));
- iounmap(base);
return;
}
--
2.25.1
More information about the linux-mtd
mailing list