mmc: sdhci: add a quirk for tuning work around
authorVincent Yang <vincent.yang.fujitsu@gmail.com>
Tue, 20 Jan 2015 08:05:16 +0000 (16:05 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jan 2015 08:29:16 +0000 (09:29 +0100)
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>
drivers/mmc/host/sdhci.c
include/linux/mmc/sdhci.h

index 3e4fe967d7e53e1dafffbd0d9dcc44b7f97b8e3a..a3ecd20e55102b6ef9c8f74a90a6d010be74eef7 100644 (file)
@@ -1961,6 +1961,8 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 
        ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
        ctrl |= SDHCI_CTRL_EXEC_TUNING;
+       if (host->quirks2 & SDHCI_QUIRK2_TUNING_WORK_AROUND)
+               ctrl |= SDHCI_CTRL_TUNED_CLK;
        sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
 
        /*
index cb8b94ff6a26b0ec4b12055c00ccfa732f4401dc..933b897ca0953775b95615642992dfde2eea607a 100644 (file)
@@ -111,6 +111,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10)
 /* Capability register bit-63 indicates HS400 support */
 #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400              (1<<11)
+/* forced tuned clock */
+#define SDHCI_QUIRK2_TUNING_WORK_AROUND                        (1<<12)
 
        int irq;                /* Device IRQ */
        void __iomem *ioaddr;   /* Mapped address */