Skip to content

Commit 9e95343

Browse files
mnaranistorulf
authored andcommitted
mmc: sdhci-of-arasan: Allow configuring zero tap values
Allow configuring the Output and Input tap values with zero to avoid failures in some cases (one of them is SD boot mode) where the output and input tap values may be already set to non-zero. Fixes: a5c8b2a ("mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup") Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> Signed-off-by: Manish Narani <manish.narani@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1605515565-117562-2-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 60d5356 commit 9e95343

1 file changed

Lines changed: 8 additions & 32 deletions

File tree

drivers/mmc/host/sdhci-of-arasan.c

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,8 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
600600
u8 tap_delay, tap_max = 0;
601601
int ret;
602602

603-
/*
604-
* This is applicable for SDHCI_SPEC_300 and above
605-
* ZynqMP does not set phase for <=25MHz clock.
606-
* If degrees is zero, no need to do anything.
607-
*/
608-
if (host->version < SDHCI_SPEC_300 ||
609-
host->timing == MMC_TIMING_LEGACY ||
610-
host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
603+
/* This is applicable for SDHCI_SPEC_300 and above */
604+
if (host->version < SDHCI_SPEC_300)
611605
return 0;
612606

613607
switch (host->timing) {
@@ -668,14 +662,8 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
668662
u8 tap_delay, tap_max = 0;
669663
int ret;
670664

671-
/*
672-
* This is applicable for SDHCI_SPEC_300 and above
673-
* ZynqMP does not set phase for <=25MHz clock.
674-
* If degrees is zero, no need to do anything.
675-
*/
676-
if (host->version < SDHCI_SPEC_300 ||
677-
host->timing == MMC_TIMING_LEGACY ||
678-
host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
665+
/* This is applicable for SDHCI_SPEC_300 and above */
666+
if (host->version < SDHCI_SPEC_300)
679667
return 0;
680668

681669
switch (host->timing) {
@@ -733,14 +721,8 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
733721
struct sdhci_host *host = sdhci_arasan->host;
734722
u8 tap_delay, tap_max = 0;
735723

736-
/*
737-
* This is applicable for SDHCI_SPEC_300 and above
738-
* Versal does not set phase for <=25MHz clock.
739-
* If degrees is zero, no need to do anything.
740-
*/
741-
if (host->version < SDHCI_SPEC_300 ||
742-
host->timing == MMC_TIMING_LEGACY ||
743-
host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
724+
/* This is applicable for SDHCI_SPEC_300 and above */
725+
if (host->version < SDHCI_SPEC_300)
744726
return 0;
745727

746728
switch (host->timing) {
@@ -804,14 +786,8 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
804786
struct sdhci_host *host = sdhci_arasan->host;
805787
u8 tap_delay, tap_max = 0;
806788

807-
/*
808-
* This is applicable for SDHCI_SPEC_300 and above
809-
* Versal does not set phase for <=25MHz clock.
810-
* If degrees is zero, no need to do anything.
811-
*/
812-
if (host->version < SDHCI_SPEC_300 ||
813-
host->timing == MMC_TIMING_LEGACY ||
814-
host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
789+
/* This is applicable for SDHCI_SPEC_300 and above */
790+
if (host->version < SDHCI_SPEC_300)
815791
return 0;
816792

817793
switch (host->timing) {

0 commit comments

Comments
 (0)