]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00175221-02 [MX6] MMCSD: clear EXE_TUNE bit after tuning finishes.
authorRyan QIAN <b32804@freescale.com>
Thu, 23 Feb 2012 00:24:53 +0000 (08:24 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:11:03 +0000 (14:11 +0200)
- add hook for post tuning in common code
- add hook for post tuning for platform code to deal with clean up stuff on
finishing tuning.

Signed-off-by: Ryan QIAN <b32804@freescale.com>
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/sd.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
include/linux/mmc/host.h

index fb541cc8a92c9829e40664a5b9cfbb04a712e118..c3f7117ea266a25495023dc3f44f476df3cb0ff4 100644 (file)
@@ -662,6 +662,13 @@ void mmc_set_clock(struct mmc_host *host, unsigned int hz)
        mmc_host_clk_release(host);
 }
 
+void mmc_finish_tuning(struct mmc_host *host)
+{
+       host->ios.finish_tuning_flag = 1;
+       mmc_set_ios(host);
+       host->ios.finish_tuning_flag = 0;
+}
+
 void mmc_set_tuning(struct mmc_host *host, unsigned int tuning)
 {
        WARN_ON(tuning < host->tuning_min);
index 84370cad499d8b7b0529adc69250f22325772fd1..afed70f7d0cc00ed07fe227ddbef483145096e7c 100644 (file)
@@ -34,6 +34,7 @@ void mmc_init_erase(struct mmc_card *card);
 void mmc_set_chip_select(struct mmc_host *host, int mode);
 void mmc_set_clock(struct mmc_host *host, unsigned int hz);
 void mmc_set_tuning(struct mmc_host *host, unsigned int tuning);
+void mmc_finish_tuning(struct mmc_host *host);
 void mmc_gate_clock(struct mmc_host *host);
 void mmc_ungate_clock(struct mmc_host *host);
 void mmc_set_ungated(struct mmc_host *host);
index 8fddc550a3c3302340253cccf9e46cba7fea4157..b7291e0444f6188dbcdbe60357e1df38027485a1 100644 (file)
@@ -648,6 +648,7 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
                avg = (min + max) / 2;
                mmc_set_tuning(card->host, avg);
                mmc_send_tuning_cmd(card);
+               mmc_finish_tuning(card->host);
        }
 #else
        if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning)
index 84ec6119abcd64b4808112ec1d8226f73932b41b..519f713ffa1855f82621276216b32e479536cde8 100755 (executable)
@@ -1328,6 +1328,12 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        if (host->flags & SDHCI_DEVICE_DEAD)
                goto out;
 
+       if (ios->finish_tuning_flag) {
+               if (host->ops->post_tuning)
+                       host->ops->post_tuning(host);
+               goto out;
+       }
+
        if (ios->tuning_flag) {
                /* means this request is for tuning only */
                if (host->ops->pre_tuning)
index e6af69ecc43fddb833632b5eb3512c7d929921a4..27b12505c65c7be44e6622717839b9c61fb6c5a9 100644 (file)
@@ -275,6 +275,7 @@ struct sdhci_ops {
        int     (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
 
        void            (*pre_tuning)(struct sdhci_host *host, u32 val);
+       void            (*post_tuning)(struct sdhci_host *host);
        void            (*platform_clk_ctrl)(struct sdhci_host *host, bool enable);
 };
 
index 66bf0fb1dbfa5fc0d07bfe3095a379347a68afa9..3fc0cc75808242f4c95c33f8b99072cfdc7c1362 100644 (file)
@@ -75,6 +75,7 @@ struct mmc_ios {
 #define MMC_SET_DRIVER_TYPE_C  2
 #define MMC_SET_DRIVER_TYPE_D  3
        unsigned int    tuning_flag;            /* request tuning only */
+       unsigned int    finish_tuning_flag;
        unsigned int    tuning;                 /* tuning parameter */
 };