Skip to content

Commit 571bfb1

Browse files
committed
mmc: sdhci-pci: Support external CD GPIO on all OF systems
Allow OF systems to specify an external CD GPIO on all devices, even if they have an internal CD feature. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 45f714b commit 571bfb1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,15 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
21172117
dev_warn(&pdev->dev, "failed to setup card detect gpio\n");
21182118
slot->cd_idx = -1;
21192119
}
2120+
} else if (is_of_node(pdev->dev.fwnode)) {
2121+
/* Allow all OF systems to use a CD GPIO if provided */
2122+
2123+
ret = mmc_gpiod_request_cd(host->mmc, "cd", 0,
2124+
slot->cd_override_level, 0);
2125+
if (ret == -EPROBE_DEFER)
2126+
goto remove;
2127+
else if (ret == 0)
2128+
slot->cd_idx = 0;
21202129
}
21212130

21222131
if (chip->fixes && chip->fixes->add_host)

0 commit comments

Comments
 (0)