]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mmc: core: Introduce MMC_CAP2_NO_SDIO cap
authorCarlo Caione <carlo@endlessm.com>
Wed, 25 Nov 2015 14:39:51 +0000 (15:39 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 22 Dec 2015 10:32:13 +0000 (11:32 +0100)
This patch introduce a new MMC_CAP2_NO_SDIO cap used to tell the mmc
core to not send SDIO specific commands.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c
include/linux/mmc/host.h

index 07b2f086213f2e12c5f27da6bd37d462f7c71d14..910aa254f23aca7763e81fa7532bb6e6ce82aca9 100644 (file)
@@ -2476,15 +2476,20 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
         * sdio_reset sends CMD52 to reset card.  Since we do not know
         * if the card is being re-initialized, just send it.  CMD52
         * should be ignored by SD/eMMC cards.
+        * Skip it if we already know that we do not support SDIO commands
         */
-       sdio_reset(host);
+       if (!(host->caps2 & MMC_CAP2_NO_SDIO))
+               sdio_reset(host);
+
        mmc_go_idle(host);
 
        mmc_send_if_cond(host, host->ocr_avail);
 
        /* Order's important: probe SDIO, then SD, then MMC */
-       if (!mmc_attach_sdio(host))
-               return 0;
+       if (!(host->caps2 & MMC_CAP2_NO_SDIO))
+               if (!mmc_attach_sdio(host))
+                       return 0;
+
        if (!mmc_attach_sd(host))
                return 0;
        if (!mmc_attach_mmc(host))
index f39888cf501795673b378db1d6bf33534351fd8a..8dd4d290ab0d8608b9596c18da8db1096715badb 100644 (file)
@@ -290,6 +290,7 @@ struct mmc_host {
 #define MMC_CAP2_HSX00_1_2V    (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
 #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
 #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18)    /* No physical write protect pin, assume that card is always read-write */
+#define MMC_CAP2_NO_SDIO       (1 << 19)       /* Do not send SDIO commands during initialization */
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */