diff mbox

[v7,12/12] OMAP2: dmtimer: set wakeup enable explicitly in plat

Message ID 1292882719-30255-13-git-send-email-tarun.kanti@ti.com (mailing list archive)
State New, archived
Delegated to: Tony Lindgren
Headers show

Commit Message

Tarun Kanti DebBarma Dec. 20, 2010, 10:05 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index f4aa4a1..007b754 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -227,6 +227,7 @@  static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg,
 
 static void omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
+	u32 l;
 	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
 
 	if (!pdata->is_omap16xx) {
@@ -243,6 +244,18 @@  static void omap_dm_timer_prepare(struct omap_dm_timer *timer)
 	if (pdata->dm_timer_reset)
 		pdata->dm_timer_reset(timer);
 
+	/*
+	 * Enable wake-up on OMAP2420, OMAP2430 CPUs.
+	 * FIXME: SYSC_HAS_ENAWAKEUP flag is already set in hwmod database.
+	 * But the setting does not seem to work. Need to investigate why
+	 * this is happening.
+	 */
+	if (cpu_is_omap2430() || cpu_is_omap2420()) {
+		l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG);
+		l |= 1 << 2;
+		omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
+	}
+
 	omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
 
 	/* Match hardware reset default of posted mode */