aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-12-08 04:04:30 -0500
committerChris Ball <cjb@laptop.org>2011-01-08 22:48:04 -0500
commit8f230f454fe04ba326ffaead3a6b88dcf44eaf4b (patch)
tree9f5c43b48aa84131f7b94b44e4d500e0ec271ba0 /drivers/mmc/host/sdhci.c
parent150ee73d1b35936aafc5fd3b39a7291b1f66de07 (diff)
mmc: Add support for JMicron 388 SD/MMC controller
JMicron 388 SD/MMC combo controller supports the 1.8V low-voltage for SD, but MMC doesn't work with the low-voltage, resulting in an error at probing. This patch adds the support for multiple voltage mask per device type, so that SD works with 1.8V while MMC forces 3.3V. Here new ocr_avail_* fields for each device are introduced, so that the actual OCR mask is switched dynamically. Also, the restriction of low-voltage in core/sd.c is removed when the bit is allowed explicitly via ocr_avail_sd mask. This patch was rewritten from scratch based on Aries' original code. Signed-off-by: Aries Lee <arieslee@jmicron.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 8a74fcbfe13b..55698864c2cd 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1739,7 +1739,7 @@ EXPORT_SYMBOL_GPL(sdhci_alloc_host);
1739int sdhci_add_host(struct sdhci_host *host) 1739int sdhci_add_host(struct sdhci_host *host)
1740{ 1740{
1741 struct mmc_host *mmc; 1741 struct mmc_host *mmc;
1742 unsigned int caps; 1742 unsigned int caps, ocr_avail;
1743 int ret; 1743 int ret;
1744 1744
1745 WARN_ON(host == NULL); 1745 WARN_ON(host == NULL);
@@ -1893,13 +1893,26 @@ int sdhci_add_host(struct sdhci_host *host)
1893 mmc_card_is_removable(mmc)) 1893 mmc_card_is_removable(mmc))
1894 mmc->caps |= MMC_CAP_NEEDS_POLL; 1894 mmc->caps |= MMC_CAP_NEEDS_POLL;
1895 1895
1896 mmc->ocr_avail = 0; 1896 ocr_avail = 0;
1897 if (caps & SDHCI_CAN_VDD_330) 1897 if (caps & SDHCI_CAN_VDD_330)
1898 mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; 1898 ocr_avail |= MMC_VDD_32_33 | MMC_VDD_33_34;
1899 if (caps & SDHCI_CAN_VDD_300) 1899 if (caps & SDHCI_CAN_VDD_300)
1900 mmc->ocr_avail |= MMC_VDD_29_30|MMC_VDD_30_31; 1900 ocr_avail |= MMC_VDD_29_30 | MMC_VDD_30_31;
1901 if (caps & SDHCI_CAN_VDD_180) 1901 if (caps & SDHCI_CAN_VDD_180)
1902 mmc->ocr_avail |= MMC_VDD_165_195; 1902 ocr_avail |= MMC_VDD_165_195;
1903
1904 mmc->ocr_avail = ocr_avail;
1905 mmc->ocr_avail_sdio = ocr_avail;
1906 if (host->ocr_avail_sdio)
1907 mmc->ocr_avail_sdio &= host->ocr_avail_sdio;
1908 mmc->ocr_avail_sd = ocr_avail;
1909 if (host->ocr_avail_sd)
1910 mmc->ocr_avail_sd &= host->ocr_avail_sd;
1911 else /* normal SD controllers don't support 1.8V */
1912 mmc->ocr_avail_sd &= ~MMC_VDD_165_195;
1913 mmc->ocr_avail_mmc = ocr_avail;
1914 if (host->ocr_avail_mmc)
1915 mmc->ocr_avail_mmc &= host->ocr_avail_mmc;
1903 1916
1904 if (mmc->ocr_avail == 0) { 1917 if (mmc->ocr_avail == 0) {
1905 printk(KERN_ERR "%s: Hardware doesn't report any " 1918 printk(KERN_ERR "%s: Hardware doesn't report any "