aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cm_common.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-03-12 12:33:45 -0400
committerTero Kristo <t-kristo@ti.com>2015-03-27 04:55:56 -0400
commitfe87414f71d0035756cf91a80ac256557d16b488 (patch)
treef9808093ca44fa2cd7f7c43182c171052945ab85 /arch/arm/mach-omap2/cm_common.c
parent9f029b1579b2dfe291006e5bfe8e7d0c4ef20828 (diff)
ARM: OMAP2+: PRCM: split PRCM module init to their own driver files
Splits the clock related provider module inits under their own driver files. Previously this was done for all modules under the common PRM driver. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/cm_common.c')
-rw-r--r--arch/arm/mach-omap2/cm_common.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
index 8fe02fcedc48..f3d578be3272 100644
--- a/arch/arm/mach-omap2/cm_common.c
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -15,10 +15,13 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/bug.h> 17#include <linux/bug.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
18 20
19#include "cm2xxx.h" 21#include "cm2xxx.h"
20#include "cm3xxx.h" 22#include "cm3xxx.h"
21#include "cm44xx.h" 23#include "cm44xx.h"
24#include "clock.h"
22 25
23/* 26/*
24 * cm_ll_data: function pointers to SoC-specific implementations of 27 * cm_ll_data: function pointers to SoC-specific implementations of
@@ -212,3 +215,51 @@ int cm_unregister(struct cm_ll_data *cld)
212 215
213 return 0; 216 return 0;
214} 217}
218
219static struct omap_prcm_init_data cm_data = {
220 .index = TI_CLKM_CM,
221};
222
223static struct omap_prcm_init_data cm2_data = {
224 .index = TI_CLKM_CM2,
225};
226
227static const struct of_device_id omap_cm_dt_match_table[] = {
228 { .compatible = "ti,omap3-cm", .data = &cm_data },
229 { .compatible = "ti,omap4-cm1", .data = &cm_data },
230 { .compatible = "ti,omap4-cm2", .data = &cm2_data },
231 { .compatible = "ti,omap5-cm-core-aon", .data = &cm_data },
232 { .compatible = "ti,omap5-cm-core", .data = &cm2_data },
233 { .compatible = "ti,dra7-cm-core-aon", .data = &cm_data },
234 { .compatible = "ti,dra7-cm-core", .data = &cm2_data },
235 { }
236};
237
238/**
239 * omap_cm_init - low level init for the CM drivers
240 *
241 * Initializes the low level clock infrastructure for CM drivers.
242 * Returns 0 in success, negative error value in failure.
243 */
244int __init omap_cm_init(void)
245{
246 struct device_node *np;
247 void __iomem *mem;
248 const struct of_device_id *match;
249 const struct omap_prcm_init_data *data;
250 int ret;
251
252 for_each_matching_node_and_match(np, omap_cm_dt_match_table, &match) {
253 data = match->data;
254
255 mem = of_iomap(np, 0);
256 if (!mem)
257 return -ENOMEM;
258
259 ret = omap2_clk_provider_init(np, data->index, mem);
260 if (ret)
261 return ret;
262 }
263
264 return 0;
265}