]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mmc: core: Allow hosts to specify non-support for MMC commands
authorShawn Lin <shawn.lin@rock-chips.com>
Fri, 1 Jul 2016 07:45:28 +0000 (15:45 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 25 Jul 2016 08:34:47 +0000 (10:34 +0200)
Host drivers which needs to valdiate for non-supported MMC
commands and returnn error code for such requests.

To improve and simplify the behaviour, let's invent MMC_CAP2_NO_MMC
which these host drivers can set to tell the mmc core to skip sending MMC
commands during card initialization.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c
include/linux/mmc/host.h

index 4c823df8deb4966184edb82f08a1b5ec2a2ce1f1..94cbf4e170e32c303e2594b34f90cbb5f7ba63d0 100644 (file)
@@ -2510,8 +2510,9 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
                if (!mmc_attach_sd(host))
                        return 0;
 
-       if (!mmc_attach_mmc(host))
-               return 0;
+       if (!(host->caps2 & MMC_CAP2_NO_MMC))
+               if (!mmc_attach_mmc(host))
+                       return 0;
 
        mmc_power_off(host);
        return -EIO;
index c22476d23b84a7ce7caa2654217d4c88228f9b21..aa4bfbf129e4585ebb89b25fca4b03c928925022 100644 (file)
@@ -310,6 +310,7 @@ struct mmc_host {
 #define MMC_CAP2_NO_SDIO       (1 << 19)       /* Do not send SDIO commands during initialization */
 #define MMC_CAP2_HS400_ES      (1 << 20)       /* Host supports enhanced strobe */
 #define MMC_CAP2_NO_SD         (1 << 21)       /* Do not send SD commands during initialization */
+#define MMC_CAP2_NO_MMC                (1 << 22)       /* Do not send (e)MMC commands during initialization */
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */