aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Yang <vincent.yang.fujitsu@gmail.com>2015-01-20 03:05:16 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2015-01-20 03:29:16 -0500
commit67d0d04a762db4bd610fd628ad683b5d7dc905e7 (patch)
tree74a3eed2bb5f6e5643ee445b28e8a871aa3f22f1
parent9d967a61b4fc77b12f4b038a9345b5cda5bb2a7a (diff)
mmc: sdhci: add a quirk for tuning work around
This patch defines a quirk for tuning work around for some sdhci host controller. It sets both SDHCI_CTRL_EXEC_TUNING and SDHCI_CTRL_TUNED_CLK for tuning. It is a preparation and will be used by Fujitsu SDHCI controller f_sdh30 driver. Signed-off-by: Vincent Yang <Vincent.Yang@tw.fujitsu.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci.c2
-rw-r--r--include/linux/mmc/sdhci.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3e4fe967d7e5..a3ecd20e5510 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1961,6 +1961,8 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
1961 1961
1962 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); 1962 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
1963 ctrl |= SDHCI_CTRL_EXEC_TUNING; 1963 ctrl |= SDHCI_CTRL_EXEC_TUNING;
1964 if (host->quirks2 & SDHCI_QUIRK2_TUNING_WORK_AROUND)
1965 ctrl |= SDHCI_CTRL_TUNED_CLK;
1964 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); 1966 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
1965 1967
1966 /* 1968 /*
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index cb8b94ff6a26..933b897ca095 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -111,6 +111,8 @@ struct sdhci_host {
111#define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) 111#define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10)
112/* Capability register bit-63 indicates HS400 support */ 112/* Capability register bit-63 indicates HS400 support */
113#define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) 113#define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11)
114/* forced tuned clock */
115#define SDHCI_QUIRK2_TUNING_WORK_AROUND (1<<12)
114 116
115 int irq; /* Device IRQ */ 117 int irq; /* Device IRQ */
116 void __iomem *ioaddr; /* Mapped address */ 118 void __iomem *ioaddr; /* Mapped address */