• Dong Aisheng's avatar
    mmc: esdhc-imx: clearing SDHCI_CTRL_EXEC_TUNING should not affect other bits · 8b2bb0ad
    Dong Aisheng authored
    Current code will clear all turning related bits like ESDHC_STD_TUNING_EN
    and ESDHC_MIX_CTRL_FBCLK_SEL when clear SDHCI_CTRL_EXEC_TUNING.
    This may cause the card which has already passed the turning to become
    unwork since the turning status lost.
    We observed this failure when enable runtime pm.
    
    BTW, imx needs to enable ESDHC_MIX_CTRL_FBCLK_SEL bit for turned clock.
    The FBCLK_SEL will be cleared when SDHCI_CTRL_TUNED_CLK is cleared
    and SDHCI_CTRL_EXEC_TUNING is not set.
    This is used in case we change to another normal card from a UHS card
    in the same slot. FBCLK_SEL is not needed for normal card.
    
    After that, SDHCI_CTRL_EXEC_TUNING will only affect ESDHC_MIX_CTRL_EXE_TUNE.
    Clearing it does not affect the turned card to remain working on UHS mode.
    Signed-off-by: default avatarDong Aisheng <b29396@freescale.com>
    Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: default avatarChris Ball <cjb@laptop.org>
    8b2bb0ad
sdhci-esdhc-imx.c 32 KB