Skip to content

Commit 9107ebb

Browse files
Micky Chingcjb
authored andcommitted
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>
1 parent b13d1f0 commit 9107ebb

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

‎drivers/mmc/host/sdhci-pci.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,18 @@ static const struct sdhci_pci_fixes sdhci_via = {
610610
.probe = via_probe,
611611
};
612612

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+
613625
static const struct pci_device_id pci_ids[] = {
614626
{
615627
.vendor = PCI_VENDOR_ID_RICOH,
@@ -731,6 +743,14 @@ static const struct pci_device_id pci_ids[] = {
731743
.driver_data = (kernel_ulong_t)&sdhci_via,
732744
},
733745

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+
734754
{
735755
.vendor = PCI_VENDOR_ID_INTEL,
736756
.device = PCI_DEVICE_ID_INTEL_MRST_SD0,

‎drivers/mmc/host/sdhci.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3020,7 +3020,8 @@ int sdhci_add_host(struct sdhci_host *host)
30203020
} else if (caps[1] & SDHCI_SUPPORT_SDR50)
30213021
mmc->caps |= MMC_CAP_UHS_SDR50;
30223022

3023-
if (caps[1] & SDHCI_SUPPORT_DDR50)
3023+
if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
3024+
!(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
30243025
mmc->caps |= MMC_CAP_UHS_DDR50;
30253026

30263027
/* Does the host need tuning for SDR50? */

‎include/linux/mmc/sdhci.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ struct sdhci_host {
100100
#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
101101
/* Controller does not support HS200 */
102102
#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6)
103+
/* Controller does not support DDR50 */
104+
#define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7)
103105

104106
int irq; /* Device IRQ */
105107
void __iomem *ioaddr; /* Mapped address */

0 commit comments

Comments
 (0)