From: Guennadi Liakhovetski Date: Tue, 4 Dec 2012 15:51:36 +0000 (+0100) Subject: mmc: extend the slot-gpio card-detection to use host's .card_event() method X-Git-Tag: v3.8-rc1~190^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=451c89578eb4791b9d329eb71a79e6715e60f89e;p=~emulex%2Finfiniband.git mmc: extend the slot-gpio card-detection to use host's .card_event() method The slot-gpio API provides a generic card-detection handler. To support a wider range of hosts it has to call the host's card-event callback, if implemented. Also increase the debounce interval to 200ms to match the SDHCI driver. Signed-off-by: Guennadi Liakhovetski Reviewed-by: Shawn Guo Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index 08c6b3dfe08..16a1c0b6f26 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -27,7 +27,13 @@ struct mmc_gpio { static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) { /* Schedule a card detection after a debounce timeout */ - mmc_detect_change(dev_id, msecs_to_jiffies(100)); + struct mmc_host *host = dev_id; + + if (host->ops->card_event) + host->ops->card_event(host); + + mmc_detect_change(host, msecs_to_jiffies(200)); + return IRQ_HANDLED; }