public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Vincent Yang <vincent.yang.fujitsu@gmail.com>
To: chris@printf.net, linux-mmc@vger.kernel.org
Cc: devicetree@vger.kernel.org, anton@enomsg.org,
	linuxppc-dev@lists.ozlabs.org, patches@linaro.org,
	andy.green@linaro.org, jaswinder.singh@linaro.org,
	Vincent.Yang@tw.fujitsu.com
Subject: [RFC PATCH v2 1/6] mmc: sdhci: add quirk for voltage switch callback
Date: Thu, 26 Jun 2014 14:23:27 +0800	[thread overview]
Message-ID: <1403763812-5495-2-git-send-email-Vincent.Yang@tw.fujitsu.com> (raw)
In-Reply-To: <1403763812-5495-1-git-send-email-Vincent.Yang@tw.fujitsu.com>

This patch defines a quirk to do a callback when
switching voltages so do controller-specific
actions.
It is a preparation and will be used by Fujitsu
SDHCI controller f_sdh30 driver.

Signed-off-by: Vincent Yang <Vincent.Yang@tw.fujitsu.com>
---
 drivers/mmc/host/sdhci.c  | 5 +++++
 drivers/mmc/host/sdhci.h  | 1 +
 include/linux/mmc/sdhci.h | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3..d62262b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1763,6 +1763,11 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
 		ctrl |= SDHCI_CTRL_VDD_180;
 		sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
 
+		/* Some controller need to do more when switching */
+		if ((host->quirks2 & SDHCI_QUIRK2_VOLTAGE_SWITCH) &&
+		    host->ops->voltage_switch)
+			host->ops->voltage_switch(host);
+
 		/* Wait for 5ms */
 		usleep_range(5000, 5500);
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 4a5cd5e..63c7a46 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	(*voltage_switch)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 08abe99..5433f04 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -98,6 +98,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_BROKEN_HS200			(1<<6)
 /* Controller does not support DDR50 */
 #define SDHCI_QUIRK2_BROKEN_DDR50			(1<<7)
+/* Do a callback when switching voltages so do controller-specific actions */
+#define SDHCI_QUIRK2_VOLTAGE_SWITCH			(1<<8)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
-- 
1.9.0


  reply	other threads:[~2014-06-26  6:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  6:23 [RFC PATCH v2 0/6] mmc: sdhci: adding support for a new Fujitsu sdhci IP Vincent Yang
2014-06-26  6:23 ` Vincent Yang [this message]
2014-06-26  6:23 ` [RFC PATCH v2 2/6] mmc: sdhci: add quirk for tuning work around Vincent Yang
2014-06-26  6:23 ` [RFC PATCH v2 3/6] mmc: sdhci: add quirk for single block transactions Vincent Yang
2014-06-26  6:23 ` [RFC PATCH v2 4/6] mmc: sdhci: host: add new f_sdh30 Vincent Yang
2014-06-26 11:03   ` Mark Rutland
2014-06-27  3:32     ` Vincent Yang
2014-06-27 10:12       ` Mark Rutland
2014-06-30  2:10         ` Vincent Yang
2014-06-26  6:23 ` [RFC PATCH v2 5/6] mmc: core: hold SD Clock before CMD11 during Signal Voltage Switch Procedure Vincent Yang
2014-06-26  6:23 ` [RFC PATCH v2 6/6] mmc: core: add manual resume capability Vincent Yang
2014-06-26  9:42   ` Ulf Hansson
2014-06-27  2:23     ` Vincent Yang
2014-06-27  9:40       ` Ulf Hansson
2014-06-27 11:00         ` Vincent Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403763812-5495-2-git-send-email-Vincent.Yang@tw.fujitsu.com \
    --to=vincent.yang.fujitsu@gmail.com \
    --cc=Vincent.Yang@tw.fujitsu.com \
    --cc=andy.green@linaro.org \
    --cc=anton@enomsg.org \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox