aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicky Ching <micky_ching@realsil.com.cn>2014-02-21 05:40:35 -0500
committerChris Ball <chris@printf.net>2014-02-22 13:19:40 -0500
commit9107ebbf9652c033eb5dd10a6ea34a132db3cde1 (patch)
tree7e5769085be6b0097bb4fde9d9fdbe4dd9bbf3a1
parentb13d1f0f9ad64bc498ced07344495ba27321419e (diff)
mmc: sdhci: add support for realtek rts5250
Add support for realtek rts5250 pci card reader. The card reader has some problems with DDR50 mode, so add a new quirks2 for broken ddr50. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--drivers/mmc/host/sdhci-pci.c20
-rw-r--r--drivers/mmc/host/sdhci.c3
-rw-r--r--include/linux/mmc/sdhci.h2
3 files changed, 24 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 0955777b6c7e..fdc612120362 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -610,6 +610,18 @@ static const struct sdhci_pci_fixes sdhci_via = {
610 .probe = via_probe, 610 .probe = via_probe,
611}; 611};
612 612
613static int rtsx_probe_slot(struct sdhci_pci_slot *slot)
614{
615 slot->host->mmc->caps2 |= MMC_CAP2_HS200;
616 return 0;
617}
618
619static const struct sdhci_pci_fixes sdhci_rtsx = {
620 .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
621 SDHCI_QUIRK2_BROKEN_DDR50,
622 .probe_slot = rtsx_probe_slot,
623};
624
613static const struct pci_device_id pci_ids[] = { 625static const struct pci_device_id pci_ids[] = {
614 { 626 {
615 .vendor = PCI_VENDOR_ID_RICOH, 627 .vendor = PCI_VENDOR_ID_RICOH,
@@ -732,6 +744,14 @@ static const struct pci_device_id pci_ids[] = {
732 }, 744 },
733 745
734 { 746 {
747 .vendor = PCI_VENDOR_ID_REALTEK,
748 .device = 0x5250,
749 .subvendor = PCI_ANY_ID,
750 .subdevice = PCI_ANY_ID,
751 .driver_data = (kernel_ulong_t)&sdhci_rtsx,
752 },
753
754 {
735 .vendor = PCI_VENDOR_ID_INTEL, 755 .vendor = PCI_VENDOR_ID_INTEL,
736 .device = PCI_DEVICE_ID_INTEL_MRST_SD0, 756 .device = PCI_DEVICE_ID_INTEL_MRST_SD0,
737 .subvendor = PCI_ANY_ID, 757 .subvendor = PCI_ANY_ID,
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9ddef4763541..8958edc03e04 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3020,7 +3020,8 @@ int sdhci_add_host(struct sdhci_host *host)
3020 } else if (caps[1] & SDHCI_SUPPORT_SDR50) 3020 } else if (caps[1] & SDHCI_SUPPORT_SDR50)
3021 mmc->caps |= MMC_CAP_UHS_SDR50; 3021 mmc->caps |= MMC_CAP_UHS_SDR50;
3022 3022
3023 if (caps[1] & SDHCI_SUPPORT_DDR50) 3023 if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
3024 !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
3024 mmc->caps |= MMC_CAP_UHS_DDR50; 3025 mmc->caps |= MMC_CAP_UHS_DDR50;
3025 3026
3026 /* Does the host need tuning for SDR50? */ 3027 /* Does the host need tuning for SDR50? */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 362927c48f97..7be12b883485 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -100,6 +100,8 @@ struct sdhci_host {
100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) 100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
101/* Controller does not support HS200 */ 101/* Controller does not support HS200 */
102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6) 102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6)
103/* Controller does not support DDR50 */
104#define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7)
103 105
104 int irq; /* Device IRQ */ 106 int irq; /* Device IRQ */
105 void __iomem *ioaddr; /* Mapped address */ 107 void __iomem *ioaddr; /* Mapped address */