Skip to content

Commit

Permalink
mmc: sdhci: add card_event callback to sdhci
Browse files Browse the repository at this point in the history
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 <csd@broadcom.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Christian Daudt authored and Chris Ball committed Jul 5, 2013
1 parent 203bb5a commit 722e128
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 722e128

Please sign in to comment.