aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/sdhci.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2006-11-08 17:06:35 -0500
committerPierre Ossman <drzeus@drzeus.cx>2006-12-01 12:54:10 -0500
commit077df884835ebf2b5db16aacd9a24691d89902a0 (patch)
tree6d812005b3f5c9062ccd8dd2157a558a9bb1f0ed /drivers/mmc/sdhci.c
parent7ccd266e676a3f0c6f8f897f58b684cac3dd1650 (diff)
mmc: sdhci high speed support
The SDHCI spec implies that is is incorrect to set a clock frequency above 25 MHz without setting the high speed bit. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r--drivers/mmc/sdhci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 54990ed26770..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)
616static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) 616static 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
@@ -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);