mmc: esdhc-imx: clearing SDHCI_CTRL_EXEC_TUNING should not affect other bits
authorDong Aisheng <b29396@freescale.com>
Mon, 4 Nov 2013 08:38:27 +0000 (16:38 +0800)
committerChris Ball <chris@printf.net>
Mon, 13 Jan 2014 17:48:08 +0000 (12:48 -0500)
commit8b2bb0adce2c0cb63fcb77f4e54ac11ae54d84c0
tree97a64d4ef884a62ce8603937e54fe399ce3649bb
parentd131a71c951088704eabe1529de99188c9e2c22c
mmc: esdhc-imx: clearing SDHCI_CTRL_EXEC_TUNING should not affect other bits

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: Dong Aisheng <b29396@freescale.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-esdhc-imx.c