aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/control.c')
-rw-r--r--arch/arm/mach-omap2/control.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index da041b4ab29c..e8818242f968 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -14,6 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of_address.h>
17 18
18#include "soc.h" 19#include "soc.h"
19#include "iomap.h" 20#include "iomap.h"
@@ -25,6 +26,7 @@
25#include "sdrc.h" 26#include "sdrc.h"
26#include "pm.h" 27#include "pm.h"
27#include "control.h" 28#include "control.h"
29#include "clock.h"
28 30
29/* Used by omap3_ctrl_save_padconf() */ 31/* Used by omap3_ctrl_save_padconf() */
30#define START_PADCONF_SAVE 0x2 32#define START_PADCONF_SAVE 0x2
@@ -611,3 +613,48 @@ void __init omap3_ctrl_init(void)
611 omap3_ctrl_setup_d2d_padconf(); 613 omap3_ctrl_setup_d2d_padconf();
612} 614}
613#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 615#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
616
617struct control_init_data {
618 int index;
619};
620
621static struct control_init_data ctrl_data = {
622 .index = TI_CLKM_CTRL,
623};
624
625static const struct of_device_id omap_scrm_dt_match_table[] = {
626 { .compatible = "ti,am3-scrm", .data = &ctrl_data },
627 { .compatible = "ti,am4-scrm", .data = &ctrl_data },
628 { .compatible = "ti,omap2-scrm", .data = &ctrl_data },
629 { .compatible = "ti,omap3-scrm", .data = &ctrl_data },
630 { }
631};
632
633/**
634 * omap_control_init - low level init for the control driver
635 *
636 * Initializes the low level clock infrastructure for control driver.
637 * Returns 0 in success, negative error value in failure.
638 */
639int __init omap_control_init(void)
640{
641 struct device_node *np;
642 void __iomem *mem;
643 const struct of_device_id *match;
644 const struct omap_prcm_init_data *data;
645 int ret;
646
647 for_each_matching_node_and_match(np, omap_scrm_dt_match_table, &match) {
648 data = match->data;
649
650 mem = of_iomap(np, 0);
651 if (!mem)
652 return -ENOMEM;
653
654 ret = omap2_clk_provider_init(np, data->index, mem);
655 if (ret)
656 return ret;
657 }
658
659 return 0;
660}