All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 03/14] MMC: OMAP: Fix timeout calculation for MMC multislot support
@ 2007-09-20 15:03 Carlos Aguiar
  0 siblings, 0 replies; only message in thread
From: Carlos Aguiar @ 2007-09-20 15:03 UTC (permalink / raw)
  To: linux >> omap-linux

From: Juha Yrjola <juha.yrjola@solidboot.com>

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>
---
 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 18f7c1b..5b09e9b 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -882,13 +882,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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-20 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 15:03 [PATCH 03/14] MMC: OMAP: Fix timeout calculation for MMC multislot support Carlos Aguiar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.