diff options
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r-- | drivers/mmc/sdhci.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 9a7d39b7cdbf..cd98117632d3 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c | |||
@@ -616,6 +616,7 @@ static void sdhci_finish_command(struct sdhci_host *host) | |||
616 | static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) | 616 | static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) |
617 | { | 617 | { |
618 | int div; | 618 | int div; |
619 | u8 ctrl; | ||
619 | u16 clk; | 620 | u16 clk; |
620 | unsigned long timeout; | 621 | unsigned long timeout; |
621 | 622 | ||
@@ -624,6 +625,13 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) | |||
624 | 625 | ||
625 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); | 626 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); |
626 | 627 | ||
628 | ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); | ||
629 | if (clock > 25000000) | ||
630 | ctrl |= SDHCI_CTRL_HISPD; | ||
631 | else | ||
632 | ctrl &= ~SDHCI_CTRL_HISPD; | ||
633 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); | ||
634 | |||
627 | if (clock == 0) | 635 | if (clock == 0) |
628 | goto out; | 636 | goto out; |
629 | 637 | ||
@@ -784,7 +792,7 @@ static int sdhci_get_ro(struct mmc_host *mmc) | |||
784 | return !(present & SDHCI_WRITE_PROTECT); | 792 | return !(present & SDHCI_WRITE_PROTECT); |
785 | } | 793 | } |
786 | 794 | ||
787 | static struct mmc_host_ops sdhci_ops = { | 795 | static const struct mmc_host_ops sdhci_ops = { |
788 | .request = sdhci_request, | 796 | .request = sdhci_request, |
789 | .set_ios = sdhci_set_ios, | 797 | .set_ios = sdhci_set_ios, |
790 | .get_ro = sdhci_get_ro, | 798 | .get_ro = sdhci_get_ro, |
@@ -1291,6 +1299,13 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1291 | else if (caps & SDHCI_CAN_VDD_180) | 1299 | else if (caps & SDHCI_CAN_VDD_180) |
1292 | mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; | 1300 | mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; |
1293 | 1301 | ||
1302 | if ((host->max_clk > 25000000) && !(caps & SDHCI_CAN_DO_HISPD)) { | ||
1303 | printk(KERN_ERR "%s: Controller reports > 25 MHz base clock," | ||
1304 | " but no high speed support.\n", | ||
1305 | host->slot_descr); | ||
1306 | mmc->f_max = 25000000; | ||
1307 | } | ||
1308 | |||
1294 | if (mmc->ocr_avail == 0) { | 1309 | if (mmc->ocr_avail == 0) { |
1295 | printk(KERN_ERR "%s: Hardware doesn't report any " | 1310 | printk(KERN_ERR "%s: Hardware doesn't report any " |
1296 | "support voltages.\n", host->slot_descr); | 1311 | "support voltages.\n", host->slot_descr); |