mmc: core: Let mmc_set_signal_voltage take ocr as parameter
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 12 Sep 2013 13:36:34 +0000 (15:36 +0200)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 09:21:49 +0000 (17:21 +0800)
This is yet another step of restructure code to be able to fixup the
setup of the negotiated ocr mask.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/sd.c
drivers/mmc/core/sdio.c

index 01279928cbd6b46a7e7ecb6a0946c5e8dac530fd..ad2f92bb35c7b3c65b4bd53245754da4d86a0174 100644 (file)
@@ -1398,7 +1398,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
 
 }
 
-int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
+int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr)
 {
        struct mmc_command cmd = {0};
        int err = 0;
@@ -1480,7 +1480,7 @@ power_cycle:
        if (err) {
                pr_debug("%s: Signal voltage switch failed, "
                        "power cycling card\n", mmc_hostname(host));
-               mmc_power_cycle(host, host->ocr);
+               mmc_power_cycle(host, ocr);
        }
 
        mmc_host_clk_release(host);
index 502769a718215f31a691ac9a92f1e261ab06a32f..443a584660f0132de2b07ee232e068575a63faf4 100644 (file)
@@ -42,7 +42,7 @@ void mmc_set_ungated(struct mmc_host *host);
 void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
 void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
 u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
-int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage);
+int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr);
 int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage);
 void mmc_set_timing(struct mmc_host *host, unsigned int timing);
 void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
index f455208d3d4b7fc18e1af14a6ef2c2fa3c4c1194..9ab1b3d670b37cd075c1d916870b0965da27709e 100644 (file)
@@ -773,7 +773,8 @@ try_again:
         */
        if (!mmc_host_is_spi(host) && rocr &&
           ((*rocr & 0x41000000) == 0x41000000)) {
-               err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180);
+               err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
+                                       host->ocr);
                if (err == -EAGAIN) {
                        retries--;
                        goto try_again;
index 67792d7d8685fdde8b25f19c3ebda79c7e002211..a3c6a00a177318274c607402a8b414a2dd22bbaa 100644 (file)
@@ -669,7 +669,8 @@ try_again:
         * it.
         */
        if (!powered_resume && (ocr & R4_18V_PRESENT) && mmc_host_uhs(host)) {
-               err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180);
+               err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
+                                       host->ocr);
                if (err == -EAGAIN) {
                        sdio_reset(host);
                        mmc_go_idle(host);