diff options
author | Philip Langdale <philipl@overt.org> | 2007-03-16 22:39:00 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-01 08:14:50 -0400 |
commit | 55556da01284af8c2174b786b3eca8e11301b656 (patch) | |
tree | 579e0dbd68021daee1ff0c5b400d9cdf71c6faf8 /drivers/mmc/host | |
parent | 4be34c99a2f3aa90fa42e62c0918f07afb8a645b (diff) |
MMC: Fix handling of low-voltage cards
Fix handling of low voltage MMC cards.
The latest MMC and SD specs both agree that support for
low-voltage operations is indicated by bit 7 in the OCR.
The MMC spec states that the low voltage range is
1.65-1.95V while the SD spec leaves the actual voltage
range undefined - meaning that there is still no such
thing as a low voltage SD card.
However, an old Sandisk spec implied that bits 7.0
represented voltages below 2.0V in 1V or 0.5V increments,
and the code was accordingly written with that expectation.
This confusion meant that host drivers attempting to support
the typical low voltage (1.8V) would set the wrong bits in
the host OCR mask (usually bits 5 and/or 6) resulting in the
the low voltage mode never being used.
This change corrects the low voltage range and adds sanity
checks on the reserved bits (0-6) and for SD cards that
claim to support low-voltage operations.
Signed-off-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a57f6a3d48d3..ff5bf73cdd25 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -659,8 +659,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) | |||
659 | pwr = SDHCI_POWER_ON; | 659 | pwr = SDHCI_POWER_ON; |
660 | 660 | ||
661 | switch (1 << power) { | 661 | switch (1 << power) { |
662 | case MMC_VDD_17_18: | 662 | case MMC_VDD_165_195: |
663 | case MMC_VDD_18_19: | ||
664 | pwr |= SDHCI_POWER_180; | 663 | pwr |= SDHCI_POWER_180; |
665 | break; | 664 | break; |
666 | case MMC_VDD_29_30: | 665 | case MMC_VDD_29_30: |
@@ -1280,7 +1279,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1280 | if (caps & SDHCI_CAN_VDD_300) | 1279 | if (caps & SDHCI_CAN_VDD_300) |
1281 | mmc->ocr_avail |= MMC_VDD_29_30|MMC_VDD_30_31; | 1280 | mmc->ocr_avail |= MMC_VDD_29_30|MMC_VDD_30_31; |
1282 | if (caps & SDHCI_CAN_VDD_180) | 1281 | if (caps & SDHCI_CAN_VDD_180) |
1283 | mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; | 1282 | mmc->ocr_avail |= MMC_VDD_165_195; |
1284 | 1283 | ||
1285 | if (mmc->ocr_avail == 0) { | 1284 | if (mmc->ocr_avail == 0) { |
1286 | printk(KERN_ERR "%s: Hardware doesn't report any " | 1285 | printk(KERN_ERR "%s: Hardware doesn't report any " |