diff options
author | T Karthik Reddy | 2019-06-25 13:39:03 +0200 |
---|---|---|
committer | Peng Fan | 2019-07-15 10:16:49 +0800 |
commit | 451931ea7002c74aafeafde8893d6eb6d7b460f0 (patch) | |
tree | 59f67b0fe152812605109fe62bbfddb61c756edc /drivers/mmc/sdhci.c | |
parent | 86a94e7b2b8cdf37138e2c5cef10193f6093a9bd (diff) |
mmc: sdhci: Read cd-gpio from devicetree
This patch reads cd-gpio property from devicetree
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r-- | drivers/mmc/sdhci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index e2bb90abbdf..4ffe74e35e0 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); |