diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2012-11-22 17:10:46 -0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-25 11:12:37 +0100 |
commit | ef0e4a606fb6d30ed8b8a72df6369068bc86ac3a (patch) | |
tree | 951b6ca1d40737c3828475681cd3c55f20c0bfda /arch/arm/mach-imx/clk-imx31.c | |
parent | 8a1a9540384e06ca94296ec571f42ebcdc6c33ce (diff) |
ARM: mx31: Replace clk_register_clkdev with clock DT lookup
Similarly as it was done for mx6q, use a DT lookup in order to make maintainance
task for the clock devices easier.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/clk-imx31.c')
-rw-r--r-- | arch/arm/mach-imx/clk-imx31.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index 590dd876d66a..a42494d22c59 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c @@ -46,11 +46,13 @@ enum mx31_clks { }; static struct clk *clk[clk_max]; +static struct clk_onecell_data clk_data; int __init mx31_clocks_init(unsigned long fref) { void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR); int i; + struct device_node *np; clk[dummy] = imx_clk_fixed("dummy", 0); clk[ckih] = imx_clk_fixed("ckih", fref); @@ -117,6 +119,14 @@ int __init mx31_clocks_init(unsigned long fref) pr_err("imx31 clk %d: register failed with %ld\n", i, PTR_ERR(clk[i])); + np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm"); + + if (np) { + clk_data.clks = clk; + clk_data.clk_num = ARRAY_SIZE(clk); + of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); + } + clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0"); clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0"); |