diff mbox

[PATCHv3,15/17] dmtimer: OMAP4 specific change in plat-omap

Message ID 1285059362-26668-1-git-send-email-tarun.kanti@ti.com (mailing list archive)
State Superseded
Delegated to: Kevin Hilman
Headers show

Commit Message

Tarun Kanti DebBarma Sept. 21, 2010, 8:56 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 9da527f..4f735d7 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -252,9 +252,19 @@  static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u8 reg,
 static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
 {
 	int c;
+	u32 reg;
+	int reset_is_active;
+	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
 
+	if (pdata->timer_ip_type == OMAP_TIMER_IP_VERSION_2) {
+		reg = OMAP_TIMER_OCP_CFG_REG;
+		reset_is_active = 1;
+	} else {
+		reg = OMAP_TIMER_SYS_STAT_REG;
+		reset_is_active = 0;
+	}
 	c = 0;
-	while (!(omap_dm_timer_read_reg(timer, OMAP_TIMER_SYS_STAT_REG) & 1)) {
+	while (omap_dm_timer_read_reg(timer, reg) == reset_is_active) {
 		c++;
 		if (c > 100000) {
 			printk(KERN_ERR "Timer failed to reset\n");