[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47EAAD6C.3050502@indt.org.br>
Date: Wed, 26 Mar 2008 16:09:16 -0400
From: Carlos Aguiar <carlos.aguiar@...t.org.br>
To: ext Pierre Ossman <drzeus-list@...eus.cx>
CC: Tony Lindgren <tony@...mide.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 08/18] MMC: OMAP: Fix timeout calculation for MMC multislot
support
From: Juha Yrjola <juha.yrjola@...idboot.com>
Fix the data timeout calculation for MMC multislot support.
Signed-off-by: Juha Yrjola <juha.yrjola@...idboot.com>
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@...ia.com>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@...t.org.br>
Signed-off-by: Tony Lindgren <tony@...mide.com>
---
drivers/mmc/host/omap.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index f652de9..e4e7537 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -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)
{
- int timeout;
+ unsigned int timeout, cycle_ns;
u16 reg;
- /* Convert ns to clock cycles by assuming 20MHz frequency
- * 1 cycle at 20MHz = 500 ns
- */
- timeout = req->data->timeout_clks + req->data->timeout_ns / 500;
+ cycle_ns = 1000000000 / host->current_slot->fclk_freq;
+ timeout = req->data->timeout_ns / cycle_ns;
+ timeout += req->data->timeout_clks;
/* Check if we need to use timeout multiplier register */
reg = OMAP_MMC_READ(host, SDIO);
-- 1.5.3.GIT
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists