]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sdhci: tegra: Avoid reading autocal timeout values when not applicable
authorSowjanya Komatineni <skomatineni@nvidia.com>
Wed, 20 May 2020 20:08:57 +0000 (13:08 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 28 May 2020 09:22:15 +0000 (11:22 +0200)
When auto calibration timeouts, calibration is disabled and fail-safe
drive strength values are programmed based on the signal voltage.

Different fail-safe drive strength values based on voltage are
applicable only for SoCs supporting 3V3 and 1V8 pad controls.

So, this patch avoids reading these properties from the device tree
for SoCs not using pad controls and the warning of missing properties
will not show up on these SoC platforms.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1590005337-1087-1-git-send-email-skomatineni@nvidia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-tegra.c

index 3e2c5101291db369ec86bd056595f6e4fdddba72..3a372ab3d12e87785a6d4f5e0adffe83b0f326d6 100644 (file)
@@ -604,6 +604,39 @@ static void tegra_sdhci_parse_pad_autocal_dt(struct sdhci_host *host)
        if (err)
                autocal->pull_down_1v8 = 0;
 
+       err = device_property_read_u32(host->mmc->parent,
+                       "nvidia,pad-autocal-pull-up-offset-sdr104",
+                       &autocal->pull_up_sdr104);
+       if (err)
+               autocal->pull_up_sdr104 = autocal->pull_up_1v8;
+
+       err = device_property_read_u32(host->mmc->parent,
+                       "nvidia,pad-autocal-pull-down-offset-sdr104",
+                       &autocal->pull_down_sdr104);
+       if (err)
+               autocal->pull_down_sdr104 = autocal->pull_down_1v8;
+
+       err = device_property_read_u32(host->mmc->parent,
+                       "nvidia,pad-autocal-pull-up-offset-hs400",
+                       &autocal->pull_up_hs400);
+       if (err)
+               autocal->pull_up_hs400 = autocal->pull_up_1v8;
+
+       err = device_property_read_u32(host->mmc->parent,
+                       "nvidia,pad-autocal-pull-down-offset-hs400",
+                       &autocal->pull_down_hs400);
+       if (err)
+               autocal->pull_down_hs400 = autocal->pull_down_1v8;
+
+       /*
+        * Different fail-safe drive strength values based on the signaling
+        * voltage are applicable for SoCs supporting 3V3 and 1V8 pad controls.
+        * So, avoid reading below device tree properties for SoCs that don't
+        * have NVQUIRK_NEEDS_PAD_CONTROL.
+        */
+       if (!(tegra_host->soc_data->nvquirks & NVQUIRK_NEEDS_PAD_CONTROL))
+               return;
+
        err = device_property_read_u32(host->mmc->parent,
                        "nvidia,pad-autocal-pull-up-offset-3v3-timeout",
                        &autocal->pull_up_3v3_timeout);
@@ -647,30 +680,6 @@ static void tegra_sdhci_parse_pad_autocal_dt(struct sdhci_host *host)
                                mmc_hostname(host->mmc));
                autocal->pull_down_1v8_timeout = 0;
        }
-
-       err = device_property_read_u32(host->mmc->parent,
-                       "nvidia,pad-autocal-pull-up-offset-sdr104",
-                       &autocal->pull_up_sdr104);
-       if (err)
-               autocal->pull_up_sdr104 = autocal->pull_up_1v8;
-
-       err = device_property_read_u32(host->mmc->parent,
-                       "nvidia,pad-autocal-pull-down-offset-sdr104",
-                       &autocal->pull_down_sdr104);
-       if (err)
-               autocal->pull_down_sdr104 = autocal->pull_down_1v8;
-
-       err = device_property_read_u32(host->mmc->parent,
-                       "nvidia,pad-autocal-pull-up-offset-hs400",
-                       &autocal->pull_up_hs400);
-       if (err)
-               autocal->pull_up_hs400 = autocal->pull_up_1v8;
-
-       err = device_property_read_u32(host->mmc->parent,
-                       "nvidia,pad-autocal-pull-down-offset-hs400",
-                       &autocal->pull_down_hs400);
-       if (err)
-               autocal->pull_down_hs400 = autocal->pull_down_1v8;
 }
 
 static void tegra_sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)