mmc: tegra: Clear tuning overrides if not required
Pavan Kunapuli [Thu, 22 Aug 2013 15:22:06 +0000 (20:22 +0530)]
If there is no need to maintain boot voltage, clear tuning
override voltages set.

Bug 1353926

Change-Id: Ie36fd98b6245839ea8ec4b6fd9a2afb4cd56ff3b
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/264940
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

drivers/mmc/host/sdhci-tegra.c

index 23d46e4..6c51a94 100644 (file)
@@ -2074,6 +2074,8 @@ static int sdhci_tegra_set_tuning_voltage(struct sdhci_host *sdhci,
                mmc_hostname(sdhci->mmc), voltage);
        /* First clear any previous dvfs override settings */
        err = tegra_dvfs_override_core_voltage(0);
+       if (!voltage)
+               return err;
 
        /* EMC clock freq boost might be required for nominal core voltage */
        if (( voltage == tegra_host->nominal_vcore_mv) &&
@@ -2286,6 +2288,8 @@ out:
        if (boot_volt_req_refcount)
                sdhci_tegra_set_tuning_voltage(sdhci,
                        tegra_host->boot_vcore_mv);
+       else
+               sdhci_tegra_set_tuning_voltage(sdhci, 0);
 
 
        /* Enable interrupts. Enable full range for core voltage */