public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mmc: sdhci: add init_card callback
@ 2014-06-13 10:25 Steffen Trumtrar
  2014-06-13 10:25 ` [PATCH v2 2/2] mmc: sdhci-esdhc-imx: add callback for card_type inits Steffen Trumtrar
  2014-06-13 11:01 ` [PATCH v2 1/2] mmc: sdhci: add init_card callback Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Steffen Trumtrar @ 2014-06-13 10:25 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Dong Aisheng, Steffen Trumtrar

Currently host drivers using the sdhci-pltfm code can not configure the
host based on the type of card inserted.

The sdio driver e.g. calls the card_init callback, so the host can now
know what card is used and configure itself accordingly.

Provide a callback for users of the sdhci-pltfm code to use this callback
function.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
Changes since v1:
	- rebased onto mmc-updates-for-3.16-rc1

 drivers/mmc/host/sdhci.c | 9 +++++++++
 drivers/mmc/host/sdhci.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3..0fa9004 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2071,6 +2071,14 @@ static void sdhci_card_event(struct mmc_host *mmc)
 	spin_unlock_irqrestore(&host->lock, flags);
 }
 
+static void sdhci_init_card(struct mmc_host *mmc, struct mmc_card *card)
+{
+	struct sdhci_host *host = mmc_priv(mmc);
+
+	if (host->ops->card_type_init)
+		host->ops->card_type_init(host, card);
+}
+
 static const struct mmc_host_ops sdhci_ops = {
 	.request	= sdhci_request,
 	.set_ios	= sdhci_set_ios,
@@ -2082,6 +2090,7 @@ static const struct mmc_host_ops sdhci_ops = {
 	.execute_tuning			= sdhci_execute_tuning,
 	.card_event			= sdhci_card_event,
 	.card_busy	= sdhci_card_busy,
+	.init_card	= sdhci_init_card,
 };
 
 /*****************************************************************************\
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 4a5cd5e..def4adf 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -292,6 +292,7 @@ struct sdhci_ops {
 	void    (*adma_workaround)(struct sdhci_host *host, u32 intmask);
 	void	(*platform_init)(struct sdhci_host *host);
 	void    (*card_event)(struct sdhci_host *host);
+	void	(*card_type_init)(struct sdhci_host *host, struct mmc_card *card);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
-- 
2.0.0.rc2


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

end of thread, other threads:[~2014-06-13 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 10:25 [PATCH v2 1/2] mmc: sdhci: add init_card callback Steffen Trumtrar
2014-06-13 10:25 ` [PATCH v2 2/2] mmc: sdhci-esdhc-imx: add callback for card_type inits Steffen Trumtrar
2014-06-13 11:01 ` [PATCH v2 1/2] mmc: sdhci: add init_card callback Ulf Hansson
2014-06-13 12:09   ` Steffen Trumtrar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox