summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/host.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2015-05-07 13:10:20 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-06-01 09:06:57 +0200
commit6376f69d20a6905c1d83be451065f70200490b98 (patch)
tree4142c2b1b4631a4811c8d0a37d205b25655fce5c /drivers/mmc/core/host.c
parented16f58dc00d47439c201ab18ca4d981210bcafd (diff)
mmc: core: Add support for HS400 re-tuning
HS400 re-tuning must be done in HS200 mode. Add the ability to switch from HS400 mode to HS200 mode before re-tuning and switch back to HS400 after re-tuning. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/host.c')
-rw-r--r--drivers/mmc/core/host.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index e90e02fc596a..86c495b7a335 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -340,6 +340,7 @@ void mmc_retune_release(struct mmc_host *host)
int mmc_retune(struct mmc_host *host)
{
+ bool return_to_hs400 = false;
int err;
if (host->retune_now)
@@ -354,8 +355,24 @@ int mmc_retune(struct mmc_host *host)
host->doing_retune = 1;
+ if (host->ios.timing == MMC_TIMING_MMC_HS400) {
+ err = mmc_hs400_to_hs200(host->card);
+ if (err)
+ goto out;
+
+ return_to_hs400 = true;
+
+ if (host->ops->prepare_hs400_tuning)
+ host->ops->prepare_hs400_tuning(host, &host->ios);
+ }
+
err = mmc_execute_tuning(host->card);
+ if (err)
+ goto out;
+ if (return_to_hs400)
+ err = mmc_hs200_to_hs400(host->card);
+out:
host->doing_retune = 0;
return err;