Skip to content

Commit 26cb2be

Browse files
wensstorulf
authored andcommitted
mmc: sunxi: Keep default timing phase settings for new timing mode
The register for the "new timing mode" also has bit fields for setting output and sample timing phases. According to comments in Allwinner's BSP kernel, the default values are good enough. Keep the default values already in the hardware when setting new timing mode, instead of overwriting the whole register. Fixes: 9a37e53 ("mmc: sunxi: Enable the new timings for the A64 MMC controllers") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 5771a8c commit 26cb2be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/mmc/host/sunxi-mmc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,12 @@ static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host,
793793
}
794794
mmc_writel(host, REG_CLKCR, rval);
795795

796-
if (host->cfg->needs_new_timings)
797-
mmc_writel(host, REG_SD_NTSR, SDXC_2X_TIMING_MODE);
796+
if (host->cfg->needs_new_timings) {
797+
/* Don't touch the delay bits */
798+
rval = mmc_readl(host, REG_SD_NTSR);
799+
rval |= SDXC_2X_TIMING_MODE;
800+
mmc_writel(host, REG_SD_NTSR, rval);
801+
}
798802

799803
ret = sunxi_mmc_clk_set_phase(host, ios, rate);
800804
if (ret)

0 commit comments

Comments
 (0)