mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <dinguyen@opensource.altera.com>
To: <linux-mmc@vger.kernel.org>
Cc: <dinh.linux@gmail.com>, <linux-kernel@vger.kernel.org>,
	<setka@vsis.cz>, Dinh Nguyen <dinguyen@opensource.altera.com>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Chris Ball <chris@printf.net>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Doug Anderson <dianders@chromium.org>
Subject: [PATCH] mmc: dw_mmc: add fixed divider for ciu_clk on SoCFPGA
Date: Fri, 10 Apr 2015 08:56:02 -0500	[thread overview]
Message-ID: <1428674162-11200-1-git-send-email-dinguyen@opensource.altera.com> (raw)

From: Dinh Nguyen <dinguyen@opensource.altera.com>

The ciu_clk(Card Interface Unit Clock) on the SoCFPGA platform has a fixed
divider of 4. Add the fixed clock divide code in the platform's clock
setup code.

Technically, this code could be be moved to dw_mmc-socfpga, like the Rockchip
and Exynos, but I don't think it's necessary for a small change that is
needed for the entire SoCFPGA family of SoCs.

Also, "altr,dw-mshc-ciu-div" can be introduced to respresent the ciu divider,
but since this divider is common across all SoCFPGA, I don't think its
necessary.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
CC: Seungwon Jeon <tgih.jun@samsung.com>
CC: Jaehoon Chung <jh80.chung@samsung.com>
CC: Chris Ball <chris@printf.net>
CC: Ulf Hansson <ulf.hansson@linaro.org>
CC: Doug Anderson <dianders@chromium.org>
---
 drivers/mmc/host/dw_mmc-pltfm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index ec6dbcd..c92f790 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -26,13 +26,22 @@
 #include "dw_mmc.h"
 #include "dw_mmc-pltfm.h"
 
+#define SOCFPGA_CIU_CLK_DIV	4
+
 static void dw_mci_pltfm_prepare_command(struct dw_mci *host, u32 *cmdr)
 {
 	*cmdr |= SDMMC_CMD_USE_HOLD_REG;
 }
 
+static int dw_mci_socfpga_setup_clock(struct dw_mci *host)
+{
+	host->bus_hz /= SOCFPGA_CIU_CLK_DIV;
+	return 0;
+}
+
 static const struct dw_mci_drv_data socfpga_drv_data = {
 	.prepare_command	= dw_mci_pltfm_prepare_command,
+	.setup_clock		= dw_mci_socfpga_setup_clock,
 };
 
 static const struct dw_mci_drv_data pistachio_drv_data = {
-- 
2.2.1


             reply	other threads:[~2015-04-10 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 13:56 dinguyen [this message]
2015-04-10 15:15 ` Doug Anderson
2015-04-10 18:08   ` Dinh Nguyen
2015-04-10 18:21     ` Doug Anderson

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=1428674162-11200-1-git-send-email-dinguyen@opensource.altera.com \
    --to=dinguyen@opensource.altera.com \
    --cc=chris@printf.net \
    --cc=dianders@chromium.org \
    --cc=dinh.linux@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=setka@vsis.cz \
    --cc=tgih.jun@samsung.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®