From 03e105ed4d26dcdc69a90b4bbd1fd97f80808c6b Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Fri, 14 Nov 2014 10:27:06 +0800 Subject: MLK-9834 mmc: sdhci-esdhc-imx: fix SD3.0 failed to resume if M/F is enabled Due to the power lost in suspend if Mega/Fast is enabled which is a new feature introduced, the static settings like tuning control in probe() function of controller will be lost which results in the later resume failed on tuning routine for SD3.0 cards(SDR50/SDR104). This patch moves the tunning setting from probe() function into register setting path before the tuning is executed. Then the tuning setting becomes dynamically and re-set again after resume for a SD3.0 card when doing tuning. Signed-off-by: Dong Aisheng (cherry picked from commit 2fb6a74b8b91dad7e57d65a57eabd422a4acc25e) --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/mmc/host') diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 2232aa6a20a0..0ceaedda723a 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -462,6 +462,10 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) if (val & SDHCI_CTRL_EXEC_TUNING) { v |= ESDHC_MIX_CTRL_EXE_TUNE; m |= ESDHC_MIX_CTRL_FBCLK_SEL; + writel(readl(host->ioaddr + ESDHC_TUNING_CTRL) | + ESDHC_STD_TUNING_EN | + ESDHC_TUNING_START_TAP, + host->ioaddr + ESDHC_TUNING_CTRL); } else { v &= ~ESDHC_MIX_CTRL_EXE_TUNE; } @@ -1072,11 +1076,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) sdhci_esdhc_ops.platform_execute_tuning = esdhc_executing_tuning; - if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) - writel(readl(host->ioaddr + ESDHC_TUNING_CTRL) | - ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP, - host->ioaddr + ESDHC_TUNING_CTRL); - if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; -- cgit v1.2.3