diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2021-10-14 13:21:27 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-10-14 13:21:27 +0200 |
commit | 92d23216fe7cd7a67f749148aacb7effd5eb34b4 (patch) | |
tree | 7edf27b7d0f18c56580443a0f47f94c9d5c597ba /drivers | |
parent | beae4a6258e64af609ad5995cc6b6056eb0d898e (diff) | |
parent | 6ab4e2eb5e956a61e4d53cea3ab8c866ba79a830 (diff) | |
download | linux-92d23216fe7cd7a67f749148aacb7effd5eb34b4.tar.bz2 |
Merge branch 'fixes' into next
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci-pci-core.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index be19785227fe..d0f2edfe296c 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -616,16 +616,12 @@ static int intel_select_drive_strength(struct mmc_card *card, return intel_host->drv_strength; } -static int bxt_get_cd(struct mmc_host *mmc) +static int sdhci_get_cd_nogpio(struct mmc_host *mmc) { - int gpio_cd = mmc_gpio_get_cd(mmc); struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; int ret = 0; - if (!gpio_cd) - return 0; - spin_lock_irqsave(&host->lock, flags); if (host->flags & SDHCI_DEVICE_DEAD) @@ -638,6 +634,21 @@ out: return ret; } +static int bxt_get_cd(struct mmc_host *mmc) +{ + int gpio_cd = mmc_gpio_get_cd(mmc); + + if (!gpio_cd) + return 0; + + return sdhci_get_cd_nogpio(mmc); +} + +static int mrfld_get_cd(struct mmc_host *mmc) +{ + return sdhci_get_cd_nogpio(mmc); +} + #define SDHCI_INTEL_PWR_TIMEOUT_CNT 20 #define SDHCI_INTEL_PWR_TIMEOUT_UDELAY 100 @@ -1341,6 +1352,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot) MMC_CAP_1_8V_DDR; break; case INTEL_MRFLD_SD: + slot->cd_idx = 0; + slot->cd_override_level = true; + /* + * There are two PCB designs of SD card slot with the opposite + * card detection sense. Quirk this out by ignoring GPIO state + * completely in the custom ->get_cd() callback. + */ + slot->host->mmc_host_ops.get_cd = mrfld_get_cd; slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; break; case INTEL_MRFLD_SDIO: |