atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Fri, 19 Sep 2008 19:09:30 +0000 (21:09 +0200)
committerPierre Ossman <drzeus@drzeus.cx>
Sat, 20 Sep 2008 10:12:23 +0000 (12:12 +0200)
This allows the mmc core to detect card insertion/removal for slots that
don't have any CD pin wired up.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/atmel-mci.c

index 39096083bb6174d3bd4d5b8f5d88401144a3932b..917035e16da4c10eb53745fc07b5b62e20738d64 100644 (file)
@@ -1059,6 +1059,10 @@ static int __init atmci_probe(struct platform_device *pdev)
                        host->present = !gpio_get_value(host->detect_pin);
                }
        }
+
+       if (!gpio_is_valid(host->detect_pin))
+               mmc->caps |= MMC_CAP_NEEDS_POLL;
+
        if (gpio_is_valid(host->wp_pin)) {
                if (gpio_request(host->wp_pin, "mmc_wp")) {
                        dev_dbg(&mmc->class_dev, "no WP pin available\n");