aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2012-03-28 05:01:10 -0400
committerChris Ball <cjb@laptop.org>2012-04-05 20:32:24 -0400
commit930f152cc9998388031af577843baae572ac8ab6 (patch)
tree216a0a14ff0758a906abbf3d51df616d9330fbc7 /drivers/mmc
parentf93882570496aa02ba8a47bfaf81cce43046b978 (diff)
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mmcif.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index d79c6430c16..4bb999ed335 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1298,14 +1298,14 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
1298 spin_lock_init(&host->lock); 1298 spin_lock_init(&host->lock);
1299 1299
1300 mmc->ops = &sh_mmcif_ops; 1300 mmc->ops = &sh_mmcif_ops;
1301 mmc->f_max = host->clk; 1301 mmc->f_max = host->clk / 2;
1302 /* close to 400KHz */ 1302 /* close to 400KHz */
1303 if (mmc->f_max < 51200000) 1303 if (host->clk < 51200000)
1304 mmc->f_min = mmc->f_max / 128; 1304 mmc->f_min = host->clk / 128;
1305 else if (mmc->f_max < 102400000) 1305 else if (host->clk < 102400000)
1306 mmc->f_min = mmc->f_max / 256; 1306 mmc->f_min = host->clk / 256;
1307 else 1307 else
1308 mmc->f_min = mmc->f_max / 512; 1308 mmc->f_min = host->clk / 512;
1309 if (pd->ocr) 1309 if (pd->ocr)
1310 mmc->ocr_avail = pd->ocr; 1310 mmc->ocr_avail = pd->ocr;
1311 mmc->caps = MMC_CAP_MMC_HIGHSPEED; 1311 mmc->caps = MMC_CAP_MMC_HIGHSPEED;