[PATCH 12/24] omap4: clocks: Make dmtimer clocks calls OMAP4 compatible

Santosh Shilimkar
2010-02-16T15:58:36Z

The gptimer library has been adapted for the OMAP4 way of clock calls.
In OMAP4, the iclk are hw controlled and no sw control is available.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/plat-omap/dmtimer.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 24bf692..e4bfeed 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -428,7 +428,9 @@ void omap_dm_timer_enable(struct omap_dm_timer *timer)
#ifdef CONFIG_ARCH_OMAP2PLUS
if (cpu_class_is_omap2()) {
clk_enable(timer->fclk);
- clk_enable(timer->iclk);
+ /* OMAP4 iclk are hw controlled and no sw control available */
+ if (!cpu_is_omap44xx())
+ clk_enable(timer->iclk);
}
#endif

@@ -443,7 +445,9 @@ void omap_dm_timer_disable(struct omap_dm_timer *timer)

#ifdef CONFIG_ARCH_OMAP2PLUS
if (cpu_class_is_omap2()) {
- clk_disable(timer->iclk);
+ /* OMAP4 iclk are hw controlled and no sw control available */
+ if (!cpu_is_omap44xx())
+ clk_disable(timer->iclk);
clk_disable(timer->fclk);
}
#endif
@@ -781,10 +785,19 @@ int __init omap_dm_timer_init(void)
#ifdef CONFIG_ARCH_OMAP2PLUS
if (cpu_class_is_omap2()) {
char clk_name[16];
- sprintf(clk_name, "gpt%d_ick", i + 1);
- timer->iclk = clk_get(NULL, clk_name);
- sprintf(clk_name, "gpt%d_fck", i + 1);
- timer->fclk = clk_get(NULL, clk_name);
+ /*
+ * OMAP4 iclks are hw controlled and no sw control
+ * is available
+ */
+ if (cpu_is_omap44xx()) {
+ sprintf(clk_name, "gptimer%d_ck", i + 1);
+ timer->fclk = clk_get(NULL, clk_name);
+ } else {
+ sprintf(clk_name, "gpt%d_ick", i + 1);
+ timer->iclk = clk_get(NULL, clk_name);
+ sprintf(clk_name, "gpt%d_fck", i + 1);
+ timer->fclk = clk_get(NULL, clk_name);
+ }
}
#endif
}
--
1.6.0.4