__raw_writel((val), (base) + OMAP_HSMMC_##reg)
enum {OFF = 0, ON};
-#define IDLE_TIMEOUT (5*HZ)
+#define IDLE_TIMEOUT (jiffies_to_msecs(10))
struct mmc_omap_host {
struct device *dev;
int ret = 0;
spin_lock_irqsave(&host->clk_lock, flags);
+ del_timer(&host->idle_timer);
if (host->fclk_enabled != state) {
if (state == ON) {
ret = clk_enable(host->fclk);
goto err_out;
dev_dbg(mmc_dev(host->mmc), "mmc_fclk: enabled\n");
- /* Revisit: Change the timer bump based on real
- MMC usage characteristics */
- mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
} else {
clk_disable(host->fclk);
dev_dbg(mmc_dev(host->mmc), "mmc_fclk: disabled\n");
- del_timer(&host->idle_timer);
}
host->fclk_enabled = state;
}
if (!data->stop) {
host->mrq = NULL;
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
mmc_request_done(host->mmc, data->mrq);
return;
}
}
if (host->data == NULL || cmd->error) {
host->mrq = NULL;
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
mmc_request_done(host->mmc, cmd->mrq);
}
}
while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD) ;
mmc_detect_change(host->mmc, (HZ * 50) / 1000);
}
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
}
/*
if (ios->power_mode == MMC_POWER_OFF)
mmc_omap_fclk_state(host, OFF);
+ else
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
}
static int omap_hsmmc_get_cd(struct mmc_host *mmc)
if (ret < 0)
goto err_cover_switch;
}
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
return 0;
ret = mmc_resume_host(host->mmc);
if (ret == 0)
host->suspended = 0;
+
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
}
return ret;