Skip to content

Commit 92d2321

Browse files
author
Ulf Hansson
committed
Merge branch 'fixes' into next
2 parents beae4a6 + 6ab4e2e commit 92d2321

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

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

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,12 @@ static int intel_select_drive_strength(struct mmc_card *card,
616616
return intel_host->drv_strength;
617617
}
618618

619-
static int bxt_get_cd(struct mmc_host *mmc)
619+
static int sdhci_get_cd_nogpio(struct mmc_host *mmc)
620620
{
621-
int gpio_cd = mmc_gpio_get_cd(mmc);
622621
struct sdhci_host *host = mmc_priv(mmc);
623622
unsigned long flags;
624623
int ret = 0;
625624

626-
if (!gpio_cd)
627-
return 0;
628-
629625
spin_lock_irqsave(&host->lock, flags);
630626

631627
if (host->flags & SDHCI_DEVICE_DEAD)
@@ -638,6 +634,21 @@ static int bxt_get_cd(struct mmc_host *mmc)
638634
return ret;
639635
}
640636

637+
static int bxt_get_cd(struct mmc_host *mmc)
638+
{
639+
int gpio_cd = mmc_gpio_get_cd(mmc);
640+
641+
if (!gpio_cd)
642+
return 0;
643+
644+
return sdhci_get_cd_nogpio(mmc);
645+
}
646+
647+
static int mrfld_get_cd(struct mmc_host *mmc)
648+
{
649+
return sdhci_get_cd_nogpio(mmc);
650+
}
651+
641652
#define SDHCI_INTEL_PWR_TIMEOUT_CNT 20
642653
#define SDHCI_INTEL_PWR_TIMEOUT_UDELAY 100
643654

@@ -1341,6 +1352,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
13411352
MMC_CAP_1_8V_DDR;
13421353
break;
13431354
case INTEL_MRFLD_SD:
1355+
slot->cd_idx = 0;
1356+
slot->cd_override_level = true;
1357+
/*
1358+
* There are two PCB designs of SD card slot with the opposite
1359+
* card detection sense. Quirk this out by ignoring GPIO state
1360+
* completely in the custom ->get_cd() callback.
1361+
*/
1362+
slot->host->mmc_host_ops.get_cd = mrfld_get_cd;
13441363
slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
13451364
break;
13461365
case INTEL_MRFLD_SDIO:

0 commit comments

Comments
 (0)