Merge branch 'at91/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[pandora-kernel.git] / arch / arm / plat-omap / dmtimer.c
index 7c5cb4e..75a847d 100644 (file)
@@ -209,8 +209,8 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer)
        }
        omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
 
-       /* Enable autoidle on OMAP2 / OMAP3 */
-       if (cpu_is_omap24xx() || cpu_is_omap34xx())
+       /* Enable autoidle on OMAP2+ */
+       if (cpu_class_is_omap2())
                autoidle = 1;
 
        /*
@@ -572,7 +572,7 @@ int omap_dm_timers_active(void)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timers_active);
 
-int __init omap_dm_timer_init(void)
+static int __init omap_dm_timer_init(void)
 {
        struct omap_dm_timer *timer;
        int i, map_size = SZ_8K;        /* Module 4KB + L4 4KB except on omap1 */
@@ -625,8 +625,16 @@ int __init omap_dm_timer_init(void)
                        sprintf(clk_name, "gpt%d_fck", i + 1);
                        timer->fclk = clk_get(NULL, clk_name);
                }
+
+               /* One or two timers may be set up early for sys_timer */
+               if (sys_timer_reserved & (1  << i)) {
+                       timer->reserved = 1;
+                       timer->posted = 1;
+               }
 #endif
        }
 
        return 0;
 }
+
+arch_initcall(omap_dm_timer_init);