diff options
author | Kevin Hilman <khilman@ti.com> | 2012-06-18 14:12:25 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-06-18 14:12:25 -0400 |
commit | 0a179eaa436e58ed9fd00e09cdf01f1b3604d9a1 (patch) | |
tree | 57ab10e8a6928a2d8189351931c329df663f8cb2 | |
parent | b8249cf2d2b16de9582d3cbaa98c16c32c624d8a (diff) |
ARM: OMAP2+: hwmod: use init-time function pointer for _init_clkdm
Rather than use runtime cpu_is* checking inside _init_clkdm, initialize
SoC specific function pointer at init time.
Signed-off-by: Kevin Hilman <khilman@ti.com>
[paul@pwsan.com: convert to use soc_ops function pointers; remove second para
from commit message since soc_ops function pointers are now set during hwmod
layer init]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 93cb96dbb54..acc616c02e1 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -185,6 +185,7 @@ struct omap_hwmod_soc_ops { | |||
185 | struct omap_hwmod_rst_info *ohri); | 185 | struct omap_hwmod_rst_info *ohri); |
186 | int (*is_hardreset_asserted)(struct omap_hwmod *oh, | 186 | int (*is_hardreset_asserted)(struct omap_hwmod *oh, |
187 | struct omap_hwmod_rst_info *ohri); | 187 | struct omap_hwmod_rst_info *ohri); |
188 | int (*init_clkdm)(struct omap_hwmod *oh); | ||
188 | }; | 189 | }; |
189 | 190 | ||
190 | /* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */ | 191 | /* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */ |
@@ -1315,9 +1316,6 @@ static struct omap_hwmod *_lookup(const char *name) | |||
1315 | */ | 1316 | */ |
1316 | static int _init_clkdm(struct omap_hwmod *oh) | 1317 | static int _init_clkdm(struct omap_hwmod *oh) |
1317 | { | 1318 | { |
1318 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | ||
1319 | return 0; | ||
1320 | |||
1321 | if (!oh->clkdm_name) { | 1319 | if (!oh->clkdm_name) { |
1322 | pr_warning("omap_hwmod: %s: no clkdm_name\n", oh->name); | 1320 | pr_warning("omap_hwmod: %s: no clkdm_name\n", oh->name); |
1323 | return -EINVAL; | 1321 | return -EINVAL; |
@@ -1358,7 +1356,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data) | |||
1358 | ret |= _init_main_clk(oh); | 1356 | ret |= _init_main_clk(oh); |
1359 | ret |= _init_interface_clks(oh); | 1357 | ret |= _init_interface_clks(oh); |
1360 | ret |= _init_opt_clks(oh); | 1358 | ret |= _init_opt_clks(oh); |
1361 | ret |= _init_clkdm(oh); | 1359 | if (soc_ops.init_clkdm) |
1360 | ret |= soc_ops.init_clkdm(oh); | ||
1362 | 1361 | ||
1363 | if (!ret) | 1362 | if (!ret) |
1364 | oh->_state = _HWMOD_STATE_CLKS_INITED; | 1363 | oh->_state = _HWMOD_STATE_CLKS_INITED; |
@@ -3569,6 +3568,7 @@ void __init omap_hwmod_init(void) | |||
3569 | soc_ops.assert_hardreset = _omap4_assert_hardreset; | 3568 | soc_ops.assert_hardreset = _omap4_assert_hardreset; |
3570 | soc_ops.deassert_hardreset = _omap4_deassert_hardreset; | 3569 | soc_ops.deassert_hardreset = _omap4_deassert_hardreset; |
3571 | soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted; | 3570 | soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted; |
3571 | soc_ops.init_clkdm = _init_clkdm; | ||
3572 | } else { | 3572 | } else { |
3573 | WARN(1, "omap_hwmod: unknown SoC type\n"); | 3573 | WARN(1, "omap_hwmod: unknown SoC type\n"); |
3574 | } | 3574 | } |