aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 02b6016393a8..1f6f47f1d82a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -990,9 +990,40 @@ static struct omap_hwmod *_lookup(const char *name)
990 990
991 return oh; 991 return oh;
992} 992}
993/**
994 * _init_clkdm - look up a clockdomain name, store pointer in omap_hwmod
995 * @oh: struct omap_hwmod *
996 *
997 * Convert a clockdomain name stored in a struct omap_hwmod into a
998 * clockdomain pointer, and save it into the struct omap_hwmod.
999 * return -EINVAL if clkdm_name does not exist or if the lookup failed.
1000 */
1001static int _init_clkdm(struct omap_hwmod *oh)
1002{
1003 if (cpu_is_omap24xx() || cpu_is_omap34xx())
1004 return 0;
1005
1006 if (!oh->clkdm_name) {
1007 pr_warning("omap_hwmod: %s: no clkdm_name\n", oh->name);
1008 return -EINVAL;
1009 }
1010
1011 oh->clkdm = clkdm_lookup(oh->clkdm_name);
1012 if (!oh->clkdm) {
1013 pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n",
1014 oh->name, oh->clkdm_name);
1015 return -EINVAL;
1016 }
1017
1018 pr_debug("omap_hwmod: %s: associated to clkdm %s\n",
1019 oh->name, oh->clkdm_name);
1020
1021 return 0;
1022}
993 1023
994/** 1024/**
995 * _init_clocks - clk_get() all clocks associated with this hwmod 1025 * _init_clocks - clk_get() all clocks associated with this hwmod. Retrieve as
1026 * well the clockdomain.
996 * @oh: struct omap_hwmod * 1027 * @oh: struct omap_hwmod *
997 * @data: not used; pass NULL 1028 * @data: not used; pass NULL
998 * 1029 *
@@ -1012,6 +1043,7 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
1012 ret |= _init_main_clk(oh); 1043 ret |= _init_main_clk(oh);
1013 ret |= _init_interface_clks(oh); 1044 ret |= _init_interface_clks(oh);
1014 ret |= _init_opt_clks(oh); 1045 ret |= _init_opt_clks(oh);
1046 ret |= _init_clkdm(oh);
1015 1047
1016 if (!ret) 1048 if (!ret)
1017 oh->_state = _HWMOD_STATE_CLKS_INITED; 1049 oh->_state = _HWMOD_STATE_CLKS_INITED;