This patch updates the plat-omap dmtimer code to support
OMAP4 specific feature.

Signed-off-by: Tarun Kanti DebBarma <[email protected]>
Signed-off-by: Partha Basak <[email protected]>
Signed-off-by: Santosh Shilimkar <[email protected]>
Signed-off-by: Tarun Kanti DebBarma <[email protected]>
Cc: Cousson, Benoit <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Tony Lindgren <[email protected]>
---
 arch/arm/plat-omap/dmtimer.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

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");
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to