diff options
author | Aries Lee <arieslee@jmicron.com> | 2010-12-15 02:14:24 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-01-08 23:52:09 -0500 |
commit | 22113efd00491310da802f3b1a9a66cfcf415fac (patch) | |
tree | 1faf6e99a591f9b6856bab6c8318eeeacb076051 /drivers/mmc/host/sdhci.c | |
parent | e6f29a8dc1602e170daf955233891a9130573a55 (diff) |
mmc: Test bus-width for old MMC devices
Some old MMC devices fail with the 4/8 bits the driver tries to use
exclusively. This patch adds a test for the given bus setup and falls
back to the lower bit mode (until 1-bit mode) when the test fails.
[Major rework and refactoring by tiwai]
[Quirk addition and many fixes by prakity]
Signed-off-by: Aries Lee <arieslee@jmicron.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Philip Rakity <prakity@marvell.com>
Tested-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 55698864c2cd..d5febe584b05 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | 25 | ||
26 | #include <linux/mmc/mmc.h> | ||
26 | #include <linux/mmc/host.h> | 27 | #include <linux/mmc/host.h> |
27 | 28 | ||
28 | #include "sdhci.h" | 29 | #include "sdhci.h" |
@@ -1521,7 +1522,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) | |||
1521 | 1522 | ||
1522 | if (intmask & SDHCI_INT_DATA_TIMEOUT) | 1523 | if (intmask & SDHCI_INT_DATA_TIMEOUT) |
1523 | host->data->error = -ETIMEDOUT; | 1524 | host->data->error = -ETIMEDOUT; |
1524 | else if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_END_BIT)) | 1525 | else if (intmask & SDHCI_INT_DATA_END_BIT) |
1526 | host->data->error = -EILSEQ; | ||
1527 | else if ((intmask & SDHCI_INT_DATA_CRC) && | ||
1528 | SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) | ||
1529 | != MMC_BUS_TEST_R) | ||
1525 | host->data->error = -EILSEQ; | 1530 | host->data->error = -EILSEQ; |
1526 | else if (intmask & SDHCI_INT_ADMA_ERROR) { | 1531 | else if (intmask & SDHCI_INT_ADMA_ERROR) { |
1527 | printk(KERN_ERR "%s: ADMA error\n", mmc_hostname(host->mmc)); | 1532 | printk(KERN_ERR "%s: ADMA error\n", mmc_hostname(host->mmc)); |