Skip to content

Commit

Permalink
mmc: extend the slot-gpio card-detection to use host's .card_event() …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
  • Loading branch information
lyakh authored and cjb committed Dec 7, 2012
1 parent 9f1fb60 commit 451c895
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 451c895

Please sign in to comment.