Skip to content

Commit

Permalink
mmc: sh_mmcif: mmc->f_max should be half of the bus clock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Horman authored and Chris Ball committed Apr 6, 2012
1 parent f938825 commit 930f152
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/mmc/host/sh_mmcif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,14 +1298,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;
Expand Down

0 comments on commit 930f152

Please sign in to comment.