Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sdhci: tegra: Avoid reading autocal timeout values when not applicable

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>

authored by

Sowjanya Komatineni and committed by
Ulf Hansson
aebbf577 d42c9fff

+33 -24
+33 -24
drivers/mmc/host/sdhci-tegra.c
··· 605 605 autocal->pull_down_1v8 = 0; 606 606 607 607 err = device_property_read_u32(host->mmc->parent, 608 + "nvidia,pad-autocal-pull-up-offset-sdr104", 609 + &autocal->pull_up_sdr104); 610 + if (err) 611 + autocal->pull_up_sdr104 = autocal->pull_up_1v8; 612 + 613 + err = device_property_read_u32(host->mmc->parent, 614 + "nvidia,pad-autocal-pull-down-offset-sdr104", 615 + &autocal->pull_down_sdr104); 616 + if (err) 617 + autocal->pull_down_sdr104 = autocal->pull_down_1v8; 618 + 619 + err = device_property_read_u32(host->mmc->parent, 620 + "nvidia,pad-autocal-pull-up-offset-hs400", 621 + &autocal->pull_up_hs400); 622 + if (err) 623 + autocal->pull_up_hs400 = autocal->pull_up_1v8; 624 + 625 + err = device_property_read_u32(host->mmc->parent, 626 + "nvidia,pad-autocal-pull-down-offset-hs400", 627 + &autocal->pull_down_hs400); 628 + if (err) 629 + autocal->pull_down_hs400 = autocal->pull_down_1v8; 630 + 631 + /* 632 + * Different fail-safe drive strength values based on the signaling 633 + * voltage are applicable for SoCs supporting 3V3 and 1V8 pad controls. 634 + * So, avoid reading below device tree properties for SoCs that don't 635 + * have NVQUIRK_NEEDS_PAD_CONTROL. 636 + */ 637 + if (!(tegra_host->soc_data->nvquirks & NVQUIRK_NEEDS_PAD_CONTROL)) 638 + return; 639 + 640 + err = device_property_read_u32(host->mmc->parent, 608 641 "nvidia,pad-autocal-pull-up-offset-3v3-timeout", 609 642 &autocal->pull_up_3v3_timeout); 610 643 if (err) { ··· 680 647 mmc_hostname(host->mmc)); 681 648 autocal->pull_down_1v8_timeout = 0; 682 649 } 683 - 684 - err = device_property_read_u32(host->mmc->parent, 685 - "nvidia,pad-autocal-pull-up-offset-sdr104", 686 - &autocal->pull_up_sdr104); 687 - if (err) 688 - autocal->pull_up_sdr104 = autocal->pull_up_1v8; 689 - 690 - err = device_property_read_u32(host->mmc->parent, 691 - "nvidia,pad-autocal-pull-down-offset-sdr104", 692 - &autocal->pull_down_sdr104); 693 - if (err) 694 - autocal->pull_down_sdr104 = autocal->pull_down_1v8; 695 - 696 - err = device_property_read_u32(host->mmc->parent, 697 - "nvidia,pad-autocal-pull-up-offset-hs400", 698 - &autocal->pull_up_hs400); 699 - if (err) 700 - autocal->pull_up_hs400 = autocal->pull_up_1v8; 701 - 702 - err = device_property_read_u32(host->mmc->parent, 703 - "nvidia,pad-autocal-pull-down-offset-hs400", 704 - &autocal->pull_down_hs400); 705 - if (err) 706 - autocal->pull_down_hs400 = autocal->pull_down_1v8; 707 650 } 708 651 709 652 static void tegra_sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)