linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: srinivas.kandagatla@linaro.org
To: Russell King <linux@arm.linux.org.uk>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org
Cc: Chris Ball <chris@printf.net>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linus.walleij@linaro.org,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH v6 06/12] mmc: mmci: add 8bit bus support in variant data
Date: Mon,  2 Jun 2014 10:09:23 +0100	[thread overview]
Message-ID: <1401700163-11670-1-git-send-email-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <1401699818-11329-1-git-send-email-srinivas.kandagatla@linaro.org>

From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patch adds 8bit bus enable to variant structure giving more flexibility
to the driver to support more SOCs which have different clock register layout.

Without this patch other new SOCs like Qcom will have to add more code
to special case them.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/mmci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index ad7e538..fa3ad83 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -52,6 +52,7 @@ static unsigned int fmax = 515633;
  * struct variant_data - MMCI variant-specific quirks
  * @clkreg: default value for MCICLOCK register
  * @clkreg_enable: enable value for MMCICLOCK register
+ * @clkreg_8bit_bus_enable: enable value for 8 bit bus
  * @datalength_bits: number of bits in the MMCIDATALENGTH register
  * @fifosize: number of bytes that can be written when MMCI_TXFIFOEMPTY
  *	      is asserted (likewise for RX)
@@ -72,6 +73,7 @@ static unsigned int fmax = 515633;
 struct variant_data {
 	unsigned int		clkreg;
 	unsigned int		clkreg_enable;
+	unsigned int		clkreg_8bit_bus_enable;
 	unsigned int		datalength_bits;
 	unsigned int		fifosize;
 	unsigned int		fifohalfsize;
@@ -113,6 +115,7 @@ static struct variant_data variant_u300 = {
 	.fifosize		= 16 * 4,
 	.fifohalfsize		= 8 * 4,
 	.clkreg_enable		= MCI_ST_U300_HWFCEN,
+	.clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS,
 	.datalength_bits	= 16,
 	.sdio			= true,
 	.pwrreg_powerup		= MCI_PWR_ON,
@@ -139,6 +142,7 @@ static struct variant_data variant_ux500 = {
 	.fifohalfsize		= 8 * 4,
 	.clkreg			= MCI_CLK_ENABLE,
 	.clkreg_enable		= MCI_ST_UX500_HWFCEN,
+	.clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS,
 	.datalength_bits	= 24,
 	.sdio			= true,
 	.st_clkdiv		= true,
@@ -154,6 +158,7 @@ static struct variant_data variant_ux500v2 = {
 	.fifohalfsize		= 8 * 4,
 	.clkreg			= MCI_CLK_ENABLE,
 	.clkreg_enable		= MCI_ST_UX500_HWFCEN,
+	.clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS,
 	.datactrl_mask_ddrmode	= MCI_ST_DPSM_DDRMODE,
 	.datalength_bits	= 24,
 	.sdio			= true,
@@ -305,7 +310,7 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
 	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
 		clk |= MCI_4BIT_BUS;
 	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)
-		clk |= MCI_ST_8BIT_BUS;
+		clk |= variant->clkreg_8bit_bus_enable;
 
 	if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50)
 		clk |= MCI_ST_UX500_NEG_EDGE;
-- 
1.9.1

  parent reply	other threads:[~2014-06-02  9:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02  9:03 [PATCH v6 00/12] Qualcomm SD Card Controller support srinivas.kandagatla
2014-06-02  9:08 ` [PATCH v6 01/12] mmc: mmci: use NSEC_PER_SEC macro srinivas.kandagatla
2014-06-02  9:08 ` [PATCH v6 02/12] mmc: mmci: Add Qualcomm specific register defines srinivas.kandagatla
2014-06-11 12:45   ` Linus Walleij
2014-06-02  9:08 ` [PATCH v6 03/12] mmc: mmci: Add enough delay between writes to CMD register srinivas.kandagatla
2014-06-11 12:46   ` Linus Walleij
2014-06-02  9:09 ` [PATCH v6 04/12] mmc: mmci: Add Qcom datactrl register variant srinivas.kandagatla
     [not found]   ` <CA+neC=Of9Ua5OxUiezmTHfzq9zkXVRCFei3xKMbXi3OGV84EHw@mail.gmail.com>
2014-07-17 10:26     ` Fwd: " prakash.burla
2014-06-02  9:09 ` [PATCH v6 05/12] mmc: mmci: add ddrmode mask to variant data srinivas.kandagatla
2014-06-02  9:09 ` srinivas.kandagatla [this message]
2014-06-02  9:09 ` [PATCH v6 07/12] mmc: mmci: add edge support to data and command out in " srinivas.kandagatla
2014-06-02  9:09 ` [PATCH v6 08/12] mmc: mmci: Add support to data commands via variant structure srinivas.kandagatla
2014-06-02  9:09 ` [PATCH v6 09/12] mmc: mmci: add f_max to " srinivas.kandagatla
2014-06-11 12:47   ` Linus Walleij
2014-06-02  9:09 ` [PATCH v6 10/12] mmc: mmci: add explicit clk control srinivas.kandagatla
2014-06-11 12:50   ` Linus Walleij
2014-06-02  9:10 ` [PATCH v6 11/12] mmc: mmci: Add Qcom specific rx_fifocnt logic srinivas.kandagatla
2014-06-11 12:52   ` Linus Walleij
2014-06-02  9:10 ` [PATCH v6 12/12] mmc: mmci: Add Qualcomm Id to amba id table srinivas.kandagatla
2014-06-11 12:52   ` Linus Walleij
     [not found]   ` <CA+neC=PRkUqcL63yNkvJNgRQqvQ+c+1g+qptM7vXH5c9-b5UDw@mail.gmail.com>
2014-07-17  8:31     ` Fwd: " prakash.burla
2014-06-11 17:35 ` [PATCH v6 00/12] Qualcomm SD Card Controller support Ulf Hansson
2014-06-11 17:37   ` Srinivas Kandagatla

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=1401700163-11670-1-git-send-email-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=chris@printf.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --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).