MMC: OMAP: Fix timeout calculation for MMC multislot support

Fix the data timeout calculation for MMC multislot support.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
Juha Yrjola 2008-03-26 16:09:16 -04:00 committed by Pierre Ossman
parent a914ded235
commit b8f9f0e90a
1 changed files with 4 additions and 5 deletions

View File

@ -861,13 +861,12 @@ static inline void set_cmd_timeout(struct mmc_omap_host *host, struct mmc_reques
static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req) static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req)
{ {
int timeout; unsigned int timeout, cycle_ns;
u16 reg; u16 reg;
/* Convert ns to clock cycles by assuming 20MHz frequency cycle_ns = 1000000000 / host->current_slot->fclk_freq;
* 1 cycle at 20MHz = 500 ns timeout = req->data->timeout_ns / cycle_ns;
*/ timeout += req->data->timeout_clks;
timeout = req->data->timeout_clks + req->data->timeout_ns / 500;
/* Check if we need to use timeout multiplier register */ /* Check if we need to use timeout multiplier register */
reg = OMAP_MMC_READ(host, SDIO); reg = OMAP_MMC_READ(host, SDIO);