linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dong Aisheng <b29396@freescale.com>
To: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, cjb@laptop.org,
	shawn.guo@linaro.org, s.hauer@pengutronix.de,
	b29396@freescale.com, wsa@the-dreams.de
Subject: [PATCH v2 2/6] mmc: sdhci-esdhc-imx: add SDHCI_TRANSFER_MODE read function
Date: Wed, 30 Oct 2013 22:09:49 +0800	[thread overview]
Message-ID: <1383142193-24950-3-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1383142193-24950-1-git-send-email-b29396@freescale.com>

Used to read out the correct value of SDHCI_TRANSFER_MODE register
for upper layer.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 1ce3511..92d5782 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -385,6 +385,22 @@ static u16 esdhc_readw_le(struct sdhci_host *host, int reg)
 		return ret;
 	}
 
+	if (unlikely(reg == SDHCI_TRANSFER_MODE)) {
+		if (esdhc_is_usdhc(imx_data)) {
+			u32 m = readl(host->ioaddr + ESDHC_MIX_CTRL);
+			ret = m & ESDHC_MIX_CTRL_SDHCI_MASK;
+			/* Swap AC23 bit */
+			if (m & ESDHC_MIX_CTRL_AC23EN) {
+				ret &= ~ESDHC_MIX_CTRL_AC23EN;
+				ret |= SDHCI_TRNS_AUTO_CMD23;
+			}
+		} else {
+			ret = readw(host->ioaddr + SDHCI_TRANSFER_MODE);
+		}
+
+		return ret;
+	}
+
 	return readw(host->ioaddr + reg);
 }
 
-- 
1.7.2.rc3



  parent reply	other threads:[~2013-10-30 14:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 14:09 [PATCH v2 0/6] mmc: sdhci-esdhc-imx: fix acmd23 unwork and ddr not supported on sabresd issues Dong Aisheng
2013-10-30 14:09 ` [PATCH v2 1/6] mmc: sdhci: clear auto cmd setting bits for no data cmds Dong Aisheng
2013-11-19 11:52   ` Fabio Estevam
2013-10-30 14:09 ` Dong Aisheng [this message]
2013-10-30 14:09 ` [PATCH v2 3/6] ARM: dts: sabresd: add usdhc4 support Dong Aisheng
2013-10-30 14:09 ` [PATCH v2 4/6] mmc: sdhci-esdhc-imx: fix cpas over write issue Dong Aisheng
2013-10-30 14:09 ` [PATCH v2 5/6] mmc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6 Dong Aisheng
2013-10-30 14:09 ` [PATCH v2 6/6] mmc: core: mmc DDR mode should not depend on UHS_DDR50 Dong Aisheng
2013-10-30 22:36   ` Ulf Hansson
2013-10-31  7:04 ` [PATCH v2 0/6] mmc: sdhci-esdhc-imx: fix acmd23 unwork and ddr not supported on sabresd issues Shawn Guo
2013-11-13 11:16   ` Dong Aisheng
2013-11-26 21:37 ` Chris Ball

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=1383142193-24950-3-git-send-email-b29396@freescale.com \
    --to=b29396@freescale.com \
    --cc=cjb@laptop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=wsa@the-dreams.de \
    /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).