summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2016-04-01 14:29:22 +0530
committerKyle Yan <kyan@codeaurora.org>2016-06-13 19:06:23 -0700
commit021c0723abd52b19ab11efc780d7769f2381f7b4 (patch)
tree04df56fdfb2b0159000d9675393cff5dd5cc7779 /drivers/mmc
parente692b64f846f8ceadb26afc2f7d7e69f77778a77 (diff)
mmc: sdhci: add a quirk to define non standard tuning
Some controllers need SW to compare the data received from the card for a tuning command. Add a quirk for such non standard controllers so that they can read the data from the controller using ADMA/PIO and do the tuning sequence from SW to determine the appropriate phase. Change-Id: I15edfdf0442e3ac678c70df29482b3304cf1215a Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c5
-rw-r--r--drivers/mmc/host/sdhci.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index af24ebf0adbf..189f5969c69e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2898,8 +2898,9 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
/* CMD19 generates _only_ Buffer Read Ready interrupt */
if (intmask & SDHCI_INT_DATA_AVAIL) {
- if (command == MMC_SEND_TUNING_BLOCK ||
- command == MMC_SEND_TUNING_BLOCK_HS200) {
+ if (!(host->quirks2 & SDHCI_QUIRK2_NON_STANDARD_TUNING) &&
+ (command == MMC_SEND_TUNING_BLOCK ||
+ command == MMC_SEND_TUNING_BLOCK_HS200)) {
host->tuning_done = 1;
wake_up(&host->buf_ready_int);
return;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 93120f17b91e..7dcf6fe4d30d 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -501,6 +501,12 @@ struct sdhci_host {
#define SDHCI_QUIRK2_USE_RESET_WORKAROUND (1<<26)
/* Some controllers doesn't have have any LED control */
#define SDHCI_QUIRK2_BROKEN_LED_CONTROL (1<<27)
+/*
+ * Some controllers doesn't follow the tuning procedure as defined in spec.
+ * The tuning data has to be compared from SW driver to validate the correct
+ * phase.
+ */
+#define SDHCI_QUIRK2_NON_STANDARD_TUNING (1 << 28)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */