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