devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: chris@printf.net, ulf.hansson@linaro.org, tony@atomide.com
Cc: devicetree@vger.kernel.org, nsekhar@ti.com, afenkart@gmail.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	kishon@ti.com, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] mmc: omap_hsmmc: set host capabilities by reading MMCHS_CAPA2 register
Date: Thu, 13 Nov 2014 18:26:17 +0530	[thread overview]
Message-ID: <1415883379-19654-2-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1415883379-19654-1-git-send-email-kishon@ti.com>

From: Viswanath Puttagunta <vishp@ti.com>

set SDR104, SDR50, DDR50 and HS200 capability flags to caps/caps2 by reading
MMCHS_CAPA2 register.

Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Suggested-by: Misael Lopez Cruz <misael.lopez@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index df27bb4..2e42ed3 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -64,6 +64,7 @@
 #define OMAP_HSMMC_ISE		0x0138
 #define OMAP_HSMMC_AC12		0x013C
 #define OMAP_HSMMC_CAPA		0x0140
+#define OMAP_HSMMC_CAPA2	0x0144
 
 #define VS18			(1 << 26)
 #define VS30			(1 << 25)
@@ -139,6 +140,10 @@
 #define ACTO	(1 << 1)
 #define ACNE	(1 << 0)
 
+#define SDR50	(1 << 0)
+#define SDR104	(1 << 1)
+#define DDR50	(1 << 2)
+
 #define MMC_AUTOSUSPEND_DELAY	100
 #define MMC_TIMEOUT_MS		20		/* 20 mSec */
 #define MMC_TIMEOUT_US		20000		/* 20000 micro Sec */
@@ -2028,6 +2033,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	unsigned tx_req, rx_req;
 	const struct omap_mmc_of_data *data;
 	void __iomem *base;
+	u32 reg;
 
 	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
 	if (match) {
@@ -2153,6 +2159,19 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	mmc->pm_caps = mmc_slot(host).pm_caps;
 
+	reg = OMAP_HSMMC_READ(host->base, OMAP_HSMMC_CAPA2);
+
+	if (reg & SDR50)
+		mmc->caps |= MMC_CAP_UHS_DDR50;
+
+	if (reg & SDR104) {
+		mmc->caps |= MMC_CAP_UHS_SDR104;
+		mmc->caps2 |= MMC_CAP2_HS200;
+	}
+
+	if (reg & DDR50)
+		mmc->caps |= MMC_CAP_UHS_DDR50;
+
 	omap_hsmmc_conf_bus_power(host);
 
 	if (!pdev->dev.of_node) {
-- 
1.7.9.5

  reply	other threads:[~2014-11-13 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:56 [RFC PATCH 0/3] DRA72: MMC HS200 support Kishon Vijay Abraham I
2014-11-13 12:56 ` Kishon Vijay Abraham I [this message]
2014-11-13 12:56 ` [RFC PATCH 2/3] mmc: omap_hsmmc: add tuning support Kishon Vijay Abraham I
2014-11-14  9:06   ` Andreas Fenkart
2014-11-14 17:41   ` Felipe Balbi
2014-11-14 18:07     ` Russell King - ARM Linux
2014-11-13 12:56 ` [RFC PATCH 3/3] ARM: dts: dra72-evm: Set the max-frequency to 192MHz Kishon Vijay Abraham I
  -- strict thread matches above, loose matches on Subject: below --
2014-11-13 14:54 [RFC PATCH 0/3] DRA72: MMC HS200 support Kishon Vijay Abraham I
2014-11-13 14:54 ` [RFC PATCH 1/3] mmc: omap_hsmmc: set host capabilities by reading MMCHS_CAPA2 register Kishon Vijay Abraham I

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=1415883379-19654-2-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=afenkart@gmail.com \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).