Skip to content

Commit 3e2b0af

Browse files
jbrun3tUlf Hansson
authored andcommitted
mmc: meson-gx: fix rx phase reset
Resetting the phase when POWER_ON is set the set_ios() call means that the phase is reset almost every time the set_ios() is called, while the expected behavior was to reset the phase on a power cycle. This had gone unnoticed until now because in all mode (except hs400) the tuning is done after the last to set_ios(). In such case, the tuning result is used anyway. In HS400, there are a few calls to set_ios() after the tuning is done, overwriting the tuning result. Resetting the phase on POWER_UP instead of POWER_ON solve the problem. Fixes: d341ca8 ("mmc: meson-gx: rework tuning function") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent ca3dcd3 commit 3e2b0af

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/mmc/host/meson-gx-mmc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,10 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
745745
case MMC_POWER_UP:
746746
if (!IS_ERR(mmc->supply.vmmc))
747747
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
748+
749+
/* Reset rx phase */
750+
clk_set_phase(host->rx_clk, 0);
751+
748752
break;
749753

750754
case MMC_POWER_ON:
@@ -758,8 +762,6 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
758762
host->vqmmc_enabled = true;
759763
}
760764

761-
/* Reset rx phase */
762-
clk_set_phase(host->rx_clk, 0);
763765
break;
764766
}
765767

0 commit comments

Comments
 (0)