From 722e1280c932dd42c474390482429ce12aff9031 Mon Sep 17 00:00:00 2001 From: Christian Daudt Date: Thu, 20 Jun 2013 14:26:36 -0700 Subject: [PATCH] mmc: sdhci: add card_event callback to sdhci Add a card_event callback to sdhci so that clients can provide their own card_event to be called when card_detect is triggered. Signed-off-by: Christian Daudt Signed-off-by: Chris Ball --- drivers/mmc/host/sdhci.c | 4 ++++ drivers/mmc/host/sdhci.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3ad3973bdb33..a78bd4f3aecc 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2062,6 +2062,10 @@ static void sdhci_card_event(struct mmc_host *mmc) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; + /* First check if client has provided their own card event */ + if (host->ops->card_event) + host->ops->card_event(host); + spin_lock_irqsave(&host->lock, flags); /* Check host->mrq first in case we are runtime suspended */ diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 379e09d9f3c1..b037f188fe44 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -294,6 +294,7 @@ struct sdhci_ops { void (*platform_resume)(struct sdhci_host *host); void (*adma_workaround)(struct sdhci_host *host, u32 intmask); void (*platform_init)(struct sdhci_host *host); + void (*card_event)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS -- 2.30.2