diff options
| author | Venkat Gopalakrishnan <venkatg@codeaurora.org> | 2015-01-09 15:11:57 -0800 |
|---|---|---|
| committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:26:02 -0700 |
| commit | 58821ee5f6552ebfcf22e8a8ee00cf9da7aad947 (patch) | |
| tree | f9552b9f47ff8f15bfd00137c4b44a26808d1de2 | |
| parent | 34e4cf13f729da24d0ff25393acea1f5fdb5e375 (diff) | |
mmc: core: Add workaround for hosts that need addtional tuning for HS400
Add a capability to identify hosts that need additional tuning for HS400
and perform a post tuning process that maybe needed for proper HS400
functionality.
Change-Id: I3895aabddce4dbecb208e3c522957e656f37e30d
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| -rw-r--r-- | drivers/mmc/core/mmc.c | 11 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 2 |
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 */ |
