mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>,
	soren.brinkmann@xilinx.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Shawn Lin <shawn.lin@rock-chips.com>
Subject: [RFC PATCH 1/4] mmc: core: add cap-enhanced-strobe support
Date: Thu,  3 Mar 2016 10:36:25 +0800	[thread overview]
Message-ID: <1456972585-8036-1-git-send-email-shawn.lin@rock-chips.com> (raw)
In-Reply-To: <1456972557-7994-1-git-send-email-shawn.lin@rock-chips.com>

This patch introduce cap-enhanced-strobe for platforms which
want to enable enhanced strobe function from DT if the mmc host
controller claims to support enhanced strobe.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

---

 Documentation/devicetree/bindings/mmc/mmc.txt | 1 +
 drivers/mmc/core/host.c                       | 2 ++
 include/linux/mmc/host.h                      | 6 ++++++
 3 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index ed23b9b..51ec979 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -39,6 +39,7 @@ Optional properties:
 - cap-power-off-card: powering off the card is safe
 - cap-mmc-hw-reset: eMMC hardware reset is supported
 - cap-sdio-irq: enable SDIO IRQ signalling on this interface
+- cap-enhanced-strobe: enable enhanced strobe function for emmc v5.1+
 - full-pwr-cycle: full power cycle of the card is supported
 - mmc-ddr-1_8v: eMMC high-speed DDR mode(1.8V I/O) is supported
 - mmc-ddr-1_2v: eMMC high-speed DDR mode(1.2V I/O) is supported
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 1d94607..b49d786 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -270,6 +270,8 @@ int mmc_of_parse(struct mmc_host *host)
 		host->caps |= MMC_CAP_HW_RESET;
 	if (of_property_read_bool(np, "cap-sdio-irq"))
 		host->caps |= MMC_CAP_SDIO_IRQ;
+	if (of_property_read_bool(np, "cap-enhanced-strobe"))
+		host->caps |= MMC_CAP_ENHANCED_STROBE;
 	if (of_property_read_bool(np, "full-pwr-cycle"))
 		host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
 	if (of_property_read_bool(np, "keep-power-in-suspend"))
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8dd4d29..2a292b3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -264,6 +264,7 @@ struct mmc_host {
 #define MMC_CAP_DRIVER_TYPE_A	(1 << 23)	/* Host supports Driver Type A */
 #define MMC_CAP_DRIVER_TYPE_C	(1 << 24)	/* Host supports Driver Type C */
 #define MMC_CAP_DRIVER_TYPE_D	(1 << 25)	/* Host supports Driver Type D */
+#define MMC_CAP_ENHANCED_STROBE	(1 << 20)	/* Host supports enhanced strobe */
 #define MMC_CAP_CMD23		(1 << 30)	/* CMD23 supported. */
 #define MMC_CAP_HW_RESET	(1 << 31)	/* Hardware reset */
 
@@ -469,6 +470,11 @@ static inline int mmc_host_uhs(struct mmc_host *host)
 		 MMC_CAP_UHS_DDR50);
 }
 
+static inline int mmc_host_enhanced_strobe(struct mmc_host *host)
+{
+	return host->caps & MMC_CAP_ENHANCED_STROBE;
+}
+
 static inline int mmc_host_packed_wr(struct mmc_host *host)
 {
 	return host->caps2 & MMC_CAP2_PACKED_WR;
-- 
2.3.7

  reply	other threads:[~2016-03-03  2:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  2:35 [RFC PATCH 0/4] Add enhanced strobe support for emmc version 5.1 or later Shawn Lin
2016-03-03  2:36 ` Shawn Lin [this message]
2016-03-03 12:08   ` [RFC PATCH 1/4] mmc: core: add cap-enhanced-strobe support Jaehoon Chung
2016-03-04  1:39     ` Shawn Lin
2016-03-03  2:36 ` [RFC PATCH 2/4] mmc: core: implement enhanced strobe support Shawn Lin
2016-03-03 13:37   ` Adrian Hunter
2016-03-04  2:00     ` Shawn Lin
2016-03-03  2:36 ` [RFC PATCH 3/4] mmc: sdhci: implement enhanced strobe callback Shawn Lin
2016-03-03  2:36 ` [RFC PATCH 4/4] mmc: sdhci-of-arasan: overwrite " Shawn Lin
2016-03-03 11:02   ` Michal Simek
2016-03-03 11:37     ` Shawn Lin

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=1456972585-8036-1-git-send-email-shawn.lin@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=ulf.hansson@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

all inboxes | Powered by JetHome®