Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218987
b: refs/heads/master
c: 0397526
h: refs/heads/master
i:
  218985: 7ca4d26
  218983: 001e1ee
v: v3
  • Loading branch information
Zhangfei Gao authored and Chris Ball committed Oct 23, 2010
1 parent adbd6ad commit ceea639
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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: c4687d5f601be3f928b815b46964f7426c31aec7
refs/heads/master: 0397526d6ae2518b6c53efd1ff1e81b7d24c91da
8 changes: 5 additions & 3 deletions trunk/drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,14 +1006,14 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
if (host->max_clk <= clock)
div = 1;
else {
for (div = 2; div < 2046; div += 2) {
for (div = 2; div < SDHCI_MAX_DIV_SPEC_300; div += 2) {
if ((host->max_clk / div) <= clock)
break;
}
}
} else {
/* Version 2.00 divisors must be a power of 2. */
for (div = 1; div < 256; div *= 2) {
for (div = 1; div < SDHCI_MAX_DIV_SPEC_200; div *= 2) {
if ((host->max_clk / div) <= clock)
break;
}
Expand Down Expand Up @@ -1835,8 +1835,10 @@ int sdhci_add_host(struct sdhci_host *host)
mmc->ops = &sdhci_ops;
if (host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else if (host->version >= SDHCI_SPEC_300)
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
else
mmc->f_min = host->max_clk / 256;
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
mmc->f_max = host->max_clk;
mmc->caps |= MMC_CAP_SDIO_IRQ;

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@
#define SDHCI_SPEC_200 1
#define SDHCI_SPEC_300 2

/*
* End of controller registers.
*/

#define SDHCI_MAX_DIV_SPEC_200 256
#define SDHCI_MAX_DIV_SPEC_300 2046

struct sdhci_ops;

struct sdhci_host {
Expand Down

0 comments on commit ceea639

Please sign in to comment.