aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/coldfire/m5407.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-05-31 11:12:55 +0200
committerArnd Bergmann <arnd@arndb.de>2021-06-08 17:00:09 +0200
commit63aadb77669a6856b26d73da85b4f788731524a3 (patch)
treeb34676b811907603d564f039a2ffc9070f65a710 /arch/m68k/coldfire/m5407.c
parentmips: ralink: convert to CONFIG_COMMON_CLK (diff)
downloadlinux-dev-63aadb77669a6856b26d73da85b4f788731524a3.tar.xz
linux-dev-63aadb77669a6856b26d73da85b4f788731524a3.zip
m68k: coldfire: use clkdev_lookup on most coldfire
Coldfire is now the only target that implements the clk_get()/clk_put() helpers itself rather than using the common implementation. Most coldfire variants only have two distinct clocks and use the clk code purely for lookup. Change those over to use clkdev_lookup instead but leave the custom clk interface for those two clocks. Also leave the four SoCs that have gated clocks. Acked-by: Greg Ungerer <gerg@linux-m68k.org> Tested-by: Greg Ungerer <gerg@linux-m68k.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/m68k/coldfire/m5407.c')
-rw-r--r--arch/m68k/coldfire/m5407.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/arch/m68k/coldfire/m5407.c b/arch/m68k/coldfire/m5407.c
index 0400d76115a1..b32efb3042a2 100644
--- a/arch/m68k/coldfire/m5407.c
+++ b/arch/m68k/coldfire/m5407.c
@@ -10,6 +10,7 @@
/***************************************************************************/
+#include <linux/clkdev.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/init.h>
@@ -23,21 +24,15 @@
DEFINE_CLK(pll, "pll.0", MCF_CLK);
DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
-DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
-DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
-DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
-DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
-DEFINE_CLK(mcfi2c0, "imx1-i2c.0", MCF_BUSCLK);
-struct clk *mcf_clks[] = {
- &clk_pll,
- &clk_sys,
- &clk_mcftmr0,
- &clk_mcftmr1,
- &clk_mcfuart0,
- &clk_mcfuart1,
- &clk_mcfi2c0,
- NULL
+static struct clk_lookup m5407_clk_lookup[] = {
+ CLKDEV_INIT(NULL, "pll.0", &clk_pll),
+ CLKDEV_INIT(NULL, "sys.0", &clk_sys),
+ CLKDEV_INIT("mcftmr.0", NULL, &clk_sys),
+ CLKDEV_INIT("mcftmr.1", NULL, &clk_sys),
+ CLKDEV_INIT("mcfuart.0", NULL, &clk_sys),
+ CLKDEV_INIT("mcfuart.1", NULL, &clk_sys),
+ CLKDEV_INIT("imx1-i2c.0", NULL, &clk_sys),
};
/***************************************************************************/
@@ -63,6 +58,8 @@ void __init config_BSP(char *commandp, int size)
mcf_mapirq2imr(29, MCFINTC_EINT5);
mcf_mapirq2imr(31, MCFINTC_EINT7);
m5407_i2c_init();
+
+ clkdev_add_table(m5407_clk_lookup, ARRAY_SIZE(m5407_clk_lookup));
}
/***************************************************************************/