* [patch 003/203] sdhci: implement CAP_CLOCK_BASE_BROKEN quirk
@ 2010-05-26 21:41 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2010-05-26 21:41 UTC (permalink / raw)
To: torvalds
Cc: akpm, avorontsov, ben, david.vrabel, linux-mmc, pierre,
richard.rojfors
From: Anton Vorontsov <avorontsov@ru.mvista.com>
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>
Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
Cc: David Vrabel <david.vrabel@csr.com>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/mmc/host/sdhci.c | 3 ++-
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff -puN drivers/mmc/host/sdhci.c~sdhci-implement-cap_clock_base_broken-quirk drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-implement-cap_clock_base_broken-quirk
+++ a/drivers/mmc/host/sdhci.c
@@ -1744,7 +1744,8 @@ int sdhci_add_host(struct sdhci_host *ho
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 -puN drivers/mmc/host/sdhci.h~sdhci-implement-cap_clock_base_broken-quirk drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-implement-cap_clock_base_broken-quirk
+++ a/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 */
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-26 21:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 21:41 [patch 003/203] sdhci: implement CAP_CLOCK_BASE_BROKEN quirk akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox