Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[cascardo/linux.git] / drivers / mmc / core / sd.c
index c2cddfd..31a9ef2 100644 (file)
@@ -660,15 +660,10 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
         * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and
         * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
         */
-       if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning &&
-                       (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
-                        card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
-               mmc_host_clk_hold(card->host);
-               err = card->host->ops->execute_tuning(card->host,
-                                                     MMC_SEND_TUNING_BLOCK);
-               mmc_host_clk_release(card->host);
-       }
-
+       if (!mmc_host_is_spi(card->host) &&
+           (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
+            card->sd_bus_speed == UHS_SDR104_BUS_SPEED))
+               err = mmc_execute_tuning(card);
 out:
        kfree(status);
 
@@ -932,6 +927,12 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
                memcpy(card->raw_cid, cid, sizeof(card->raw_cid));
        }
 
+       /*
+        * Call the optional HC's init_card function to handle quirks.
+        */
+       if (host->ops->init_card)
+               host->ops->init_card(host, card);
+
        /*
         * For native busses:  get card RCA and quit open drain mode.
         */
@@ -1191,6 +1192,12 @@ static int mmc_sd_power_restore(struct mmc_host *host)
        return ret;
 }
 
+static int mmc_sd_reset(struct mmc_host *host)
+{
+       mmc_power_cycle(host, host->card->ocr);
+       return mmc_sd_power_restore(host);
+}
+
 static const struct mmc_bus_ops mmc_sd_ops = {
        .remove = mmc_sd_remove,
        .detect = mmc_sd_detect,
@@ -1201,6 +1208,7 @@ static const struct mmc_bus_ops mmc_sd_ops = {
        .power_restore = mmc_sd_power_restore,
        .alive = mmc_sd_alive,
        .shutdown = mmc_sd_suspend,
+       .reset = mmc_sd_reset,
 };
 
 /*
@@ -1271,4 +1279,3 @@ err:
 
        return err;
 }
-