From: Thomas Abraham <thomas.ab@samsung.com>
To: linux-mmc@vger.kernel.org
Cc: ben-linux@fluff.org, linux-samsung-soc@vger.kernel.org,
Thomas Abraham <thomas.ab@samsung.com>
Subject: [PATCH] S3C: SDHCI: Modify timeout clock calculation.
Date: Fri, 05 Mar 2010 12:32:43 +0530 [thread overview]
Message-ID: <1267772563-14846-1-git-send-email-thomas.ab@samsung.com> (raw)
In sdhci_s3c_set_clock function of S3C SDHCI controller driver, when a new
clock source is selected, the timeout clock is recalculated. This patch
modifies the calculation of the timeout clock based on the
SDHCI_TIMEOUT_CLK_UNIT capability which is determined from the
SDHCI_CAPABILITIES register.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
---
drivers/mmc/host/sdhci-s3c.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 50997d2..ab4641c 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -181,6 +181,7 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
if (ourhost->cur_clk != best_src) {
struct clk *clk = ourhost->clk_bus[best_src];
+ unsigned int caps;
/* turn clock off to card before changing clock source */
writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
@@ -188,7 +189,10 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
ourhost->cur_clk = best_src;
host->max_clk = clk_get_rate(clk);
host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
-
+ caps = readl(host->ioaddr + SDHCI_CAPABILITIES);
+ if (caps & SDHCI_TIMEOUT_CLK_UNIT)
+ host->timeout_clk *= 1000;
+
ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
ctrl |= best_src << S3C_SDHCI_CTRL2_SELBASECLK_SHIFT;
--
1.6.6.rc2
next reply other threads:[~2010-03-05 7:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 7:02 Thomas Abraham [this message]
2010-08-27 19:36 ` [PATCH] S3C: SDHCI: Modify timeout clock calculation 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=1267772563-14846-1-git-send-email-thomas.ab@samsung.com \
--to=thomas.ab@samsung.com \
--cc=ben-linux@fluff.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.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