blob: 49db503a2580cba095e74537236b013ad4d80884 [file] [log] [blame]
From f75a73e27d80a451ca2d71defb9a19412eda150b Mon Sep 17 00:00:00 2001
From: Simon Horman <horms@verge.net.au>
Date: Wed, 28 Mar 2012 18:01:10 +0900
Subject: mmc: sh_mmcif: mmc->f_max should be half of the bus clock
mmc->f_max should be half of the bus clock.
And now that mmc->f_max is not equal to the bus clock the
latter should be used directly to calculate mmc->f_min.
Cc: Magnus Damm <magnus.damm@gmail.com>
Tested-by: Cao Minh Hiep <hiepcm@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 930f152cc9998388031af577843baae572ac8ab6)
Signed-off-by: Simon Horman <horms@verge.net.au>
---
drivers/mmc/host/sh_mmcif.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 6288046..347b330 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1297,14 +1297,14 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
spin_lock_init(&host->lock);
mmc->ops = &sh_mmcif_ops;
- mmc->f_max = host->clk;
+ mmc->f_max = host->clk / 2;
/* close to 400KHz */
- if (mmc->f_max < 51200000)
- mmc->f_min = mmc->f_max / 128;
- else if (mmc->f_max < 102400000)
- mmc->f_min = mmc->f_max / 256;
+ if (host->clk < 51200000)
+ mmc->f_min = host->clk / 128;
+ else if (host->clk < 102400000)
+ mmc->f_min = host->clk / 256;
else
- mmc->f_min = mmc->f_max / 512;
+ mmc->f_min = host->clk / 512;
if (pd->ocr)
mmc->ocr_avail = pd->ocr;
mmc->caps = MMC_CAP_MMC_HIGHSPEED;
--
1.7.10.2.565.gbd578b5