Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Micky Ching and committed by
Chris Ball
9107ebbf b13d1f0f

+24 -1
+20
drivers/mmc/host/sdhci-pci.c
··· 610 610 .probe = via_probe, 611 611 }; 612 612 613 + static int rtsx_probe_slot(struct sdhci_pci_slot *slot) 614 + { 615 + slot->host->mmc->caps2 |= MMC_CAP2_HS200; 616 + return 0; 617 + } 618 + 619 + static 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 + 613 625 static const struct pci_device_id pci_ids[] = { 614 626 { 615 627 .vendor = PCI_VENDOR_ID_RICOH, ··· 741 729 .subvendor = PCI_ANY_ID, 742 730 .subdevice = PCI_ANY_ID, 743 731 .driver_data = (kernel_ulong_t)&sdhci_via, 732 + }, 733 + 734 + { 735 + .vendor = PCI_VENDOR_ID_REALTEK, 736 + .device = 0x5250, 737 + .subvendor = PCI_ANY_ID, 738 + .subdevice = PCI_ANY_ID, 739 + .driver_data = (kernel_ulong_t)&sdhci_rtsx, 744 740 }, 745 741 746 742 {
+2 -1
drivers/mmc/host/sdhci.c
··· 3020 3020 } else if (caps[1] & SDHCI_SUPPORT_SDR50) 3021 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 3025 mmc->caps |= MMC_CAP_UHS_DDR50; 3025 3026 3026 3027 /* Does the host need tuning for SDR50? */
+2
include/linux/mmc/sdhci.h
··· 100 100 #define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) 101 101 /* Controller does not support HS200 */ 102 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 106 int irq; /* Device IRQ */ 105 107 void __iomem *ioaddr; /* Mapped address */