Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96357
b: refs/heads/master
c: c8df9a5
h: refs/heads/master
i:
  96355: ab09c8a
v: v3
  • Loading branch information
Linus Walleij authored and Russell King committed May 4, 2008
1 parent f016e81 commit 7876323
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8b6389bd53361a19ec5236e298527c9c905ca4d
refs/heads/master: c8df9a53e8d16877fc0b268b002af2a47a14643a
14 changes: 13 additions & 1 deletion trunk/drivers/mmc/host/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->cclk = host->mclk;
} else {
clk = host->mclk / (2 * ios->clock) - 1;
if (clk > 256)
if (clk >= 256)
clk = 255;
host->cclk = host->mclk / (2 * (clk + 1));
}
Expand Down Expand Up @@ -512,6 +512,18 @@ static int mmci_probe(struct amba_device *dev, void *id)

host->plat = plat;
host->mclk = clk_get_rate(host->clk);
/*
* According to the spec, mclk is max 100 MHz,
* so we try to adjust the clock down to this,
* (if possible).
*/
if (host->mclk > 100000000) {
ret = clk_set_rate(host->clk, 100000000);
if (ret < 0)
goto clk_disable;
host->mclk = clk_get_rate(host->clk);
DBG(host, "eventual mclk rate: %u Hz\n", host->mclk);
}
host->mmc = mmc;
host->base = ioremap(dev->res.start, SZ_4K);
if (!host->base) {
Expand Down

0 comments on commit 7876323

Please sign in to comment.