]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: tegra: Check clk Status before running dll calibration
authorNaveen Kumar Arepalli <naveenk@nvidia.com>
Wed, 24 Dec 2014 11:35:10 +0000 (17:05 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Wed, 28 Jan 2015 08:44:14 +0000 (00:44 -0800)
Bug 200065544

Change-Id: I4feebbeb2365cd3464fdef872960bd7a55b2fadf
Signed-off-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/667662
(cherry picked from commit c01a58b4a5ee9552ab0ea6d2d420fff6e7979b4c)
Reviewed-on: http://git-master/r/678143
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/mmc/host/sdhci-tegra.c

index e729df67c22f181f00a028a4fe83dc259fd2f1a4..0f2401f8560370a2a9efea540527df88c101c3a4 100644 (file)
@@ -3978,12 +3978,23 @@ 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;
+       bool is_sdhci_clk_turned_on = false;
 
        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)
+       if (dll_calib_req) {
+               if (!sdhci->is_clk_on) {
+                       if (sdhci->mmc->ios.clock) {
+                               sdhci->mmc->ops->set_ios(sdhci->mmc,
+                                                       &sdhci->mmc->ios);
+                               is_sdhci_clk_turned_on = true;
+                       }
+               }
                tegra_sdhci_do_dll_calibration(sdhci);
+               if (is_sdhci_clk_turned_on)
+                       tegra_sdhci_set_clock(sdhci, 0);
+       }
 
        /* Turn OFF the clocks if the device is not present */
        if ((!tegra_host->card_present || !sdhci->mmc->card) &&