Message ID | 5658008d944f1519cc0004d19d5a16c590b5e0de.1561462741.git.michal.simek@xilinx.com |
---|---|
State | Accepted |
Commit | 451931ea7002c74aafeafde8893d6eb6d7b460f0 |
Delegated to: | Peng Fan |
Headers | show |
Series | Add SDHCI card detection support | expand |
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index e2bb90abbdf3..4ffe74e35e08 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -590,6 +590,12 @@ static int sdhci_set_ios(struct mmc *mmc) static int sdhci_init(struct mmc *mmc) { struct sdhci_host *host = mmc->priv; +#if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_GPIO) + struct udevice *dev = mmc->dev; + + gpio_request_by_name(dev, "cd-gpio", 0, + &host->cd_gpio, GPIOD_IS_IN); +#endif sdhci_reset(host, SDHCI_RESET_ALL);