From f8e365742cb5c54e1835f4b8ccafb31c1574fb11 Mon Sep 17 00:00:00 2001 From: Juha Yrjola Date: Wed, 26 Mar 2008 16:09:16 -0400 Subject: [PATCH] --- yaml --- r: 91779 b: refs/heads/master c: b8f9f0e90a6c3fb999d00301f45bb2213dbe8c00 h: refs/heads/master i: 91777: ae95db327446310a74a5b571e52c7a62a0fb62a0 91775: 8c1bafb635d44832554ca8aaec156acd7690de71 v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/omap.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 301fd7934964..7c10d21540d0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a914ded23565d8688e2b7e435916630def5bdd19 +refs/heads/master: b8f9f0e90a6c3fb999d00301f45bb2213dbe8c00 diff --git a/trunk/drivers/mmc/host/omap.c b/trunk/drivers/mmc/host/omap.c index 90e9d68e7998..0d3cd3c23f8f 100644 --- a/trunk/drivers/mmc/host/omap.c +++ b/trunk/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);