mmc: renesas_sdhi: better reset from HS400 mode
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 20 Nov 2022 11:34:55 +0000 (12:34 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 7 Dec 2022 12:22:37 +0000 (13:22 +0100)
Up to now, HS400 adjustment mode was only disabled on soft reset when a
calibration table was in use. It is safer, though, to disable it as soon
as the instance has an adjustment related quirk set, i.e. bad taps or a
calibration table.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20221120113457.42010-3-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi_core.c

index 4372197dc2a90ee893e6b7064a8aa7146a901e54..d2521cf1411db49d9f074f768c38470afa5f57f2 100644 (file)
@@ -546,7 +546,7 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
                         SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) &
                        sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
 
-       if (priv->adjust_hs400_calib_table)
+       if (priv->quirks && (priv->quirks->hs400_calib_table || priv->quirks->hs400_bad_taps))
                renesas_sdhi_adjust_hs400_mode_disable(host);
 
        sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, CLK_CTL_SCLKEN |