devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 1/2] mmc: sdhci: add card_event callback to sdhci
@ 2013-06-20 21:26 Christian Daudt
  2013-06-20 21:26 ` [PATCH V5 2/2] ARM: mmc: bcm281xx SDHCI driver Christian Daudt
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Daudt @ 2013-06-20 21:26 UTC (permalink / raw)
  To: Grant Likely, Rob Herring, Rob Landley, Russell King, Chris Ball,
	Stephen Warren, Olof Johansson, Greg Kroah-Hartman, Wei WANG,
	Anton Vorontsov, Lars-Peter Clausen, Shawn Guo, Bill Pemberton,
	Guennadi Liakhovetski, Viresh Kumar, Sascha Hauer, Jerry Huang,
	Kevin Liu, Haojian Zhuang, Ludovic Desroches, Arnd Bergmann,
	matt.porter
  Cc: csd_b, Christian Daudt

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>

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 2ea429c..c0d24ef 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2046,6 +2046,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 379e09d..b037f18 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
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-20 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 21:26 [PATCH V5 1/2] mmc: sdhci: add card_event callback to sdhci Christian Daudt
2013-06-20 21:26 ` [PATCH V5 2/2] ARM: mmc: bcm281xx SDHCI driver Christian Daudt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).