Commit 930f152c authored by Simon Horman's avatar Simon Horman Committed by Chris Ball

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: default avatarCao Minh Hiep <hiepcm@gmail.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent f9388257
...@@ -1298,14 +1298,14 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev) ...@@ -1298,14 +1298,14 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
spin_lock_init(&host->lock); spin_lock_init(&host->lock);
mmc->ops = &sh_mmcif_ops; mmc->ops = &sh_mmcif_ops;
mmc->f_max = host->clk; mmc->f_max = host->clk / 2;
/* close to 400KHz */ /* close to 400KHz */
if (mmc->f_max < 51200000) if (host->clk < 51200000)
mmc->f_min = mmc->f_max / 128; mmc->f_min = host->clk / 128;
else if (mmc->f_max < 102400000) else if (host->clk < 102400000)
mmc->f_min = mmc->f_max / 256; mmc->f_min = host->clk / 256;
else else
mmc->f_min = mmc->f_max / 512; mmc->f_min = host->clk / 512;
if (pd->ocr) if (pd->ocr)
mmc->ocr_avail = pd->ocr; mmc->ocr_avail = pd->ocr;
mmc->caps = MMC_CAP_MMC_HIGHSPEED; mmc->caps = MMC_CAP_MMC_HIGHSPEED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment