Add MMC_CAP_NEEDS_POLL flag for card detect if no gpio is passed otherwise use gpio as card detect. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xxxxxxxxxx> --- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 812e75a..7e02190 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -23,6 +23,8 @@ #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of_device.h> +#include <linux/mmc/host.h> +#include <linux/mmc/slot-gpio.h> #include <linux/phy/phy.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> @@ -728,6 +730,11 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto err_add_host; + if (mmc_card_is_removable(host->mmc) && + mmc_gpio_get_cd(host->mmc) < 0) { + host->mmc->caps |= MMC_CAP_NEEDS_POLL; + } + pm_runtime_put(&pdev->dev); return 0; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html