Commit 722e1280 authored by Christian Daudt's avatar Christian Daudt Committed by Chris Ball

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: default avatarChristian Daudt <csd@broadcom.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 203bb5af
...@@ -2062,6 +2062,10 @@ static void sdhci_card_event(struct mmc_host *mmc) ...@@ -2062,6 +2062,10 @@ static void sdhci_card_event(struct mmc_host *mmc)
struct sdhci_host *host = mmc_priv(mmc); struct sdhci_host *host = mmc_priv(mmc);
unsigned long flags; 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); spin_lock_irqsave(&host->lock, flags);
/* Check host->mrq first in case we are runtime suspended */ /* Check host->mrq first in case we are runtime suspended */
......
...@@ -294,6 +294,7 @@ struct sdhci_ops { ...@@ -294,6 +294,7 @@ struct sdhci_ops {
void (*platform_resume)(struct sdhci_host *host); void (*platform_resume)(struct sdhci_host *host);
void (*adma_workaround)(struct sdhci_host *host, u32 intmask); void (*adma_workaround)(struct sdhci_host *host, u32 intmask);
void (*platform_init)(struct sdhci_host *host); void (*platform_init)(struct sdhci_host *host);
void (*card_event)(struct sdhci_host *host);
}; };
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment