summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/mmc.c11
-rw-r--r--include/linux/mmc/host.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index d1f46fa6343d..c2963f43d61c 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1139,6 +1139,17 @@ static int mmc_select_hs400(struct mmc_card *card)
goto out_err;
}
+ if ((host->caps2 & MMC_CAP2_HS400_POST_TUNING) && host->ops->execute_tuning) {
+ mmc_host_clk_hold(host);
+ err = host->ops->execute_tuning(host,
+ MMC_SEND_TUNING_BLOCK_HS200);
+ mmc_host_clk_release(host);
+
+ if (err)
+ pr_warn("%s: tuning execution failed\n",
+ mmc_hostname(host));
+ }
+
return 0;
out_err:
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index ff861fd2517b..fca8e4a04c3b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -318,6 +318,8 @@ struct mmc_host {
#define MMC_CAP2_CLK_SCALE (1 << 20) /* Allow dynamic clk scaling */
/* Allows Asynchronous SDIO irq while card is in 4-bit mode */
#define MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE (1 << 21)
+/* Some hosts need additional tuning */
+#define MMC_CAP2_HS400_POST_TUNING (1 << 22)
#define MMC_CAP2_NONHOTPLUG (1 << 25) /*Don't support hotplug*/
mmc_pm_flag_t pm_caps; /* supported pm features */