]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: tegra: run dll calib in device resume
authorR Raj Kumar <rrajk@nvidia.com>
Thu, 30 Oct 2014 13:35:51 +0000 (19:05 +0530)
committerR Raj Kumar <rrajk@nvidia.com>
Sat, 1 Nov 2014 05:44:11 +0000 (22:44 -0700)
Run dll calibration during device resume also
instead of restoring these values in resume
if the eMMC device is running in HS400 mode.

Bug 200048968

Change-Id: I2a2adbcc0062eed09a0716cc253bc00297e41f98
Signed-off-by: R Raj Kumar <rrajk@nvidia.com>
Reviewed-on: http://git-master/r/591737
Reviewed-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
drivers/mmc/host/sdhci-tegra.c

index a5416d0fd089b760cbedfe0f31d03f4d7885079a..d4512f051f2a51b520e460be3b32339fe400c1d3 100644 (file)
@@ -1473,11 +1473,6 @@ static void tegra_sdhci_reset_exit(struct sdhci_host *host, u8 mask)
                vendor_ctrl &= ~(SDHCI_VNDR_TUN_CTRL1_TUN_STEP_SIZE);
                sdhci_writel(host, vendor_ctrl, SDHCI_VNDR_TUN_CTRL1_0);
        }
-
-       /* Restore DLL calibration and DQS Trim delay values */
-       if (plat->dll_calib_needed && tegra_host->dll_calib)
-               sdhci_writel(host, tegra_host->dll_calib,
-                               SDHCI_VNDR_DLLCAL_CFG);
        if (plat->dqs_trim_delay) {
                misc_ctrl = sdhci_readl(host, SDHCI_VNDR_CAP_OVERRIDES_0);
                misc_ctrl &= ~(SDHCI_VNDR_CAP_OVERRIDES_0_DQS_TRIM_MASK <<
@@ -3874,11 +3869,18 @@ static void tegra_sdhci_post_resume(struct sdhci_host *sdhci)
 {
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
        struct sdhci_tegra *tegra_host = pltfm_host->priv;
+       bool dll_calib_req = false;
 
        /* Turn OFF the clocks if the device is not present */
        if ((!tegra_host->card_present || !sdhci->mmc->card) &&
                tegra_host->clk_enabled)
                tegra_sdhci_set_clock(sdhci, 0);
+
+       dll_calib_req = (sdhci->mmc->card &&
+               (sdhci->mmc->card->type == MMC_TYPE_MMC) &&
+               (sdhci->mmc->ios.timing == MMC_TIMING_MMC_HS400));
+       if (dll_calib_req)
+               tegra_sdhci_do_dll_calibration(sdhci);
 }
 
 /*