From 770e31d3ca8948318c013c34d9f12dac343574a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juha=20Yrj=C3=B6l=C3=A4?= Date: Fri, 1 Jul 2005 05:20:56 -0700 Subject: [PATCH] [PATCH] ARM: OMAP: Reduce MMC clock frequency MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reduce the MMC clock frequency slightly to make all cards work. Otherwise weird CRC errors seem to happen with many RS-MMC cards. Signed-off-by: Juha Yrjölä --- drivers/mmc/omap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index af7e0aeac2b..7f4c74e0316 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -845,15 +845,18 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (ios->clock == 0) { dsor = 0; } else { - dsor = 48000000 / realclock; + int func_clk_rate = clk_get_rate(host->clk); + + dsor = func_clk_rate / realclock; if (dsor < 1) dsor = 1; - if (48000000 / dsor > realclock) + if (func_clk_rate / dsor > realclock) dsor++; if (dsor > 250) dsor = 250; + dsor++; } /* REVISIT: if (ios->bus_width == MMC_BUS_WIDTH_4) dsor |= 1 << 15; */ -- 2.41.0