aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Yrjola <juha.yrjola@solidboot.com>2008-03-26 16:09:16 -0400
committerPierre Ossman <drzeus@drzeus.cx>2008-04-18 14:05:29 -0400
commitb8f9f0e90a6c3fb999d00301f45bb2213dbe8c00 (patch)
tree1b267da4641dc1bd000491601d198fe85bca677b
parenta914ded23565d8688e2b7e435916630def5bdd19 (diff)
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>
-rw-r--r--drivers/mmc/host/omap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 90e9d68e7998..0d3cd3c23f8f 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
861 861
862static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req) 862static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req)
863{ 863{
864 int timeout; 864 unsigned int timeout, cycle_ns;
865 u16 reg; 865 u16 reg;
866 866
867 /* Convert ns to clock cycles by assuming 20MHz frequency 867 cycle_ns = 1000000000 / host->current_slot->fclk_freq;
868 * 1 cycle at 20MHz = 500 ns 868 timeout = req->data->timeout_ns / cycle_ns;
869 */ 869 timeout += req->data->timeout_clks;
870 timeout = req->data->timeout_clks + req->data->timeout_ns / 500;
871 870
872 /* Check if we need to use timeout multiplier register */ 871 /* Check if we need to use timeout multiplier register */
873 reg = OMAP_MMC_READ(host, SDIO); 872 reg = OMAP_MMC_READ(host, SDIO);