From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "David Vrabel" <david.vrabel@csr.com>,
"Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>,
"Pierre Ossman" <pierre@ossman.eu>,
"Ben Dooks" <ben@simtec.co.uk>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] sdhci: Implement CAP_CLOCK_BASE_BROKEN quirk
Date: Tue, 16 Mar 2010 21:34:27 +0300 [thread overview]
Message-ID: <20100316183427.GA25670@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100316183400.GA24191@oksana.dev.rtsoft.ru>
Some hosts (e.g. as found in CNS3xxx SOCs) report wrong value in
CLOCK_BASE capability field, and currently there is no way to
force the SDHCI core to use the platform-provided base clock value.
This patch implements CAP_CLOCK_BASE_BROKEN quirk. When enabled,
the SDHCI core will always use base clock frequency provided by
the platform.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/mmc/host/sdhci.c | 3 ++-
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d6ab62d..b03e875 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1743,7 +1743,8 @@ int sdhci_add_host(struct sdhci_host *host)
host->max_clk =
(caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
host->max_clk *= 1000000;
- if (host->max_clk == 0) {
+ if (host->max_clk == 0 || host->quirks &
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) {
if (!host->ops->get_max_clock) {
printk(KERN_ERR
"%s: Hardware doesn't specify base clock "
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 842f46f..831bf7f 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -236,6 +236,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23)
/* Controller uses SDCLK instead of TMCLK for data timeouts */
#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24)
+/* Controller reports wrong base clock capability */
+#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
int irq; /* Device IRQ */
void __iomem * ioaddr; /* Mapped address */
--
1.7.0
next prev parent reply other threads:[~2010-03-16 18:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-16 18:34 [PATCH resend 0/3] sdhci-pltfm: Few additions and enhancements Anton Vorontsov
2010-03-16 18:34 ` Anton Vorontsov [this message]
2010-03-16 18:34 ` [PATCH 2/3] sdhci-pltfm: Implement platform data passing Anton Vorontsov
2010-03-17 6:14 ` Richard Röjfors
2010-04-23 18:26 ` [PATCH] sdhci-pltfm: Add kernel-doc for struct sdhci_pltfm_data Anton Vorontsov
2010-03-16 18:34 ` [PATCH 3/3] sdhci-pltfm: Do not print errors in case of an extended iomem size Anton Vorontsov
2010-03-17 6:02 ` Richard Röjfors
2010-03-22 19:30 ` Andrew Morton
2010-04-23 18:25 ` Anton Vorontsov
2010-05-03 6:01 ` Richard Röjfors
-- strict thread matches above, loose matches on Subject: below --
2010-02-19 19:48 [PATCH 1/3] sdhci: Implement CAP_CLOCK_BASE_BROKEN quirk Anton Vorontsov
2010-02-19 19:55 ` David Vrabel
2010-02-19 20:11 ` Anton Vorontsov
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=20100316183427.GA25670@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=ben@simtec.co.uk \
--cc=david.vrabel@csr.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=pierre@ossman.eu \
--cc=richard.rojfors.ext@mocean-labs.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.