aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/mmc.c2
-rw-r--r--drivers/mmc/core/sd.c5
-rw-r--r--drivers/mmc/core/sdio.c2
-rw-r--r--drivers/mmc/host/sdhci-pci.c47
-rw-r--r--drivers/mmc/host/sdhci.c23
5 files changed, 67 insertions, 12 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 77f93c3b8808..76bb621e9aa9 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -745,6 +745,8 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
745 WARN_ON(!host->claimed); 745 WARN_ON(!host->claimed);
746 746
747 mmc_attach_bus_ops(host); 747 mmc_attach_bus_ops(host);
748 if (host->ocr_avail_mmc)
749 host->ocr_avail = host->ocr_avail_mmc;
748 750
749 /* 751 /*
750 * We need to get OCR a different way for SPI. 752 * We need to get OCR a different way for SPI.
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 49da4dffd28e..de062ebd8b26 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -772,6 +772,8 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
772 WARN_ON(!host->claimed); 772 WARN_ON(!host->claimed);
773 773
774 mmc_sd_attach_bus_ops(host); 774 mmc_sd_attach_bus_ops(host);
775 if (host->ocr_avail_sd)
776 host->ocr_avail = host->ocr_avail_sd;
775 777
776 /* 778 /*
777 * We need to get OCR a different way for SPI. 779 * We need to get OCR a different way for SPI.
@@ -795,7 +797,8 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
795 ocr &= ~0x7F; 797 ocr &= ~0x7F;
796 } 798 }
797 799
798 if (ocr & MMC_VDD_165_195) { 800 if ((ocr & MMC_VDD_165_195) &&
801 !(host->ocr_avail_sd & MMC_VDD_165_195)) {
799 printk(KERN_WARNING "%s: SD card claims to support the " 802 printk(KERN_WARNING "%s: SD card claims to support the "
800 "incompletely defined 'low voltage range'. This " 803 "incompletely defined 'low voltage range'. This "
801 "will be ignored.\n", mmc_hostname(host)); 804 "will be ignored.\n", mmc_hostname(host));
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index efef5f94ac42..c18810ab6465 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -700,6 +700,8 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
700 WARN_ON(!host->claimed); 700 WARN_ON(!host->claimed);
701 701
702 mmc_attach_bus(host, &mmc_sdio_ops); 702 mmc_attach_bus(host, &mmc_sdio_ops);
703 if (host->ocr_avail_sdio)
704 host->ocr_avail = host->ocr_avail_sdio;
703 705
704 /* 706 /*
705 * Sanity check the voltages that the card claims to 707 * Sanity check the voltages that the card claims to
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 831cf91b644a..d2638ffc4ed2 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -272,6 +272,7 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)
272static int jmicron_probe(struct sdhci_pci_chip *chip) 272static int jmicron_probe(struct sdhci_pci_chip *chip)
273{ 273{
274 int ret; 274 int ret;
275 u16 mmcdev = 0;
275 276
276 if (chip->pdev->revision == 0) { 277 if (chip->pdev->revision == 0) {
277 chip->quirks |= SDHCI_QUIRK_32BIT_DMA_ADDR | 278 chip->quirks |= SDHCI_QUIRK_32BIT_DMA_ADDR |
@@ -293,12 +294,17 @@ static int jmicron_probe(struct sdhci_pci_chip *chip)
293 * 2. The MMC interface has a lower subfunction number 294 * 2. The MMC interface has a lower subfunction number
294 * than the SD interface. 295 * than the SD interface.
295 */ 296 */
296 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_SD) { 297 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_SD)
298 mmcdev = PCI_DEVICE_ID_JMICRON_JMB38X_MMC;
299 else if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_SD)
300 mmcdev = PCI_DEVICE_ID_JMICRON_JMB388_ESD;
301
302 if (mmcdev) {
297 struct pci_dev *sd_dev; 303 struct pci_dev *sd_dev;
298 304
299 sd_dev = NULL; 305 sd_dev = NULL;
300 while ((sd_dev = pci_get_device(PCI_VENDOR_ID_JMICRON, 306 while ((sd_dev = pci_get_device(PCI_VENDOR_ID_JMICRON,
301 PCI_DEVICE_ID_JMICRON_JMB38X_MMC, sd_dev)) != NULL) { 307 mmcdev, sd_dev)) != NULL) {
302 if ((PCI_SLOT(chip->pdev->devfn) == 308 if ((PCI_SLOT(chip->pdev->devfn) ==
303 PCI_SLOT(sd_dev->devfn)) && 309 PCI_SLOT(sd_dev->devfn)) &&
304 (chip->pdev->bus == sd_dev->bus)) 310 (chip->pdev->bus == sd_dev->bus))
@@ -358,11 +364,21 @@ static int jmicron_probe_slot(struct sdhci_pci_slot *slot)
358 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; 364 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
359 } 365 }
360 366
367 /* JM388 MMC doesn't support 1.8V while SD supports it */
368 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) {
369 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 |
370 MMC_VDD_29_30 | MMC_VDD_30_31 |
371 MMC_VDD_165_195; /* allow 1.8V */
372 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 |
373 MMC_VDD_29_30 | MMC_VDD_30_31; /* no 1.8V for MMC */
374 }
375
361 /* 376 /*
362 * The secondary interface requires a bit set to get the 377 * The secondary interface requires a bit set to get the
363 * interrupts. 378 * interrupts.
364 */ 379 */
365 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC) 380 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
381 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD)
366 jmicron_enable_mmc(slot->host, 1); 382 jmicron_enable_mmc(slot->host, 1);
367 383
368 return 0; 384 return 0;
@@ -373,7 +389,8 @@ static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead)
373 if (dead) 389 if (dead)
374 return; 390 return;
375 391
376 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC) 392 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
393 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD)
377 jmicron_enable_mmc(slot->host, 0); 394 jmicron_enable_mmc(slot->host, 0);
378} 395}
379 396
@@ -381,7 +398,8 @@ static int jmicron_suspend(struct sdhci_pci_chip *chip, pm_message_t state)
381{ 398{
382 int i; 399 int i;
383 400
384 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC) { 401 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
402 chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) {
385 for (i = 0;i < chip->num_slots;i++) 403 for (i = 0;i < chip->num_slots;i++)
386 jmicron_enable_mmc(chip->slots[i]->host, 0); 404 jmicron_enable_mmc(chip->slots[i]->host, 0);
387 } 405 }
@@ -393,7 +411,8 @@ static int jmicron_resume(struct sdhci_pci_chip *chip)
393{ 411{
394 int ret, i; 412 int ret, i;
395 413
396 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC) { 414 if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
415 chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) {
397 for (i = 0;i < chip->num_slots;i++) 416 for (i = 0;i < chip->num_slots;i++)
398 jmicron_enable_mmc(chip->slots[i]->host, 1); 417 jmicron_enable_mmc(chip->slots[i]->host, 1);
399 } 418 }
@@ -582,6 +601,22 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
582 }, 601 },
583 602
584 { 603 {
604 .vendor = PCI_VENDOR_ID_JMICRON,
605 .device = PCI_DEVICE_ID_JMICRON_JMB388_SD,
606 .subvendor = PCI_ANY_ID,
607 .subdevice = PCI_ANY_ID,
608 .driver_data = (kernel_ulong_t)&sdhci_jmicron,
609 },
610
611 {
612 .vendor = PCI_VENDOR_ID_JMICRON,
613 .device = PCI_DEVICE_ID_JMICRON_JMB388_ESD,
614 .subvendor = PCI_ANY_ID,
615 .subdevice = PCI_ANY_ID,
616 .driver_data = (kernel_ulong_t)&sdhci_jmicron,
617 },
618
619 {
585 .vendor = PCI_VENDOR_ID_SYSKONNECT, 620 .vendor = PCI_VENDOR_ID_SYSKONNECT,
586 .device = 0x8000, 621 .device = 0x8000,
587 .subvendor = PCI_ANY_ID, 622 .subvendor = PCI_ANY_ID,
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 "