diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2016-06-21 09:12:46 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-07-25 04:34:22 -0400 |
commit | 1b8d79c5494484d140f2a19101412b51e2d5f6b5 (patch) | |
tree | 83b19b871e56b507ce55102e4b99098ff3aeedae | |
parent | 2801b95e8ff0fc24d7708a67bb98902dad197635 (diff) |
mmc: core: Allow hosts to specify non-support for SD commands
There are host drivers which needs to valdiate for non-supported SD
commands and returnn error code for such requests.
To improve and simplify the behaviour, let's invent MMC_CAP2_NO_SD
which these host drivers can set to tell the mmc core to skip sending SD
commands during card initialization.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/core/core.c | 9 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 1d24b3ad2a5d..4c823df8deb4 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2498,15 +2498,18 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) | |||
2498 | 2498 | ||
2499 | mmc_go_idle(host); | 2499 | mmc_go_idle(host); |
2500 | 2500 | ||
2501 | mmc_send_if_cond(host, host->ocr_avail); | 2501 | if (!(host->caps2 & MMC_CAP2_NO_SD)) |
2502 | mmc_send_if_cond(host, host->ocr_avail); | ||
2502 | 2503 | ||
2503 | /* Order's important: probe SDIO, then SD, then MMC */ | 2504 | /* Order's important: probe SDIO, then SD, then MMC */ |
2504 | if (!(host->caps2 & MMC_CAP2_NO_SDIO)) | 2505 | if (!(host->caps2 & MMC_CAP2_NO_SDIO)) |
2505 | if (!mmc_attach_sdio(host)) | 2506 | if (!mmc_attach_sdio(host)) |
2506 | return 0; | 2507 | return 0; |
2507 | 2508 | ||
2508 | if (!mmc_attach_sd(host)) | 2509 | if (!(host->caps2 & MMC_CAP2_NO_SD)) |
2509 | return 0; | 2510 | if (!mmc_attach_sd(host)) |
2511 | return 0; | ||
2512 | |||
2510 | if (!mmc_attach_mmc(host)) | 2513 | if (!mmc_attach_mmc(host)) |
2511 | return 0; | 2514 | return 0; |
2512 | 2515 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index d72c0c34c21d..c22476d23b84 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -309,6 +309,7 @@ struct mmc_host { | |||
309 | #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */ | 309 | #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */ |
310 | #define MMC_CAP2_NO_SDIO (1 << 19) /* Do not send SDIO commands during initialization */ | 310 | #define MMC_CAP2_NO_SDIO (1 << 19) /* Do not send SDIO commands during initialization */ |
311 | #define MMC_CAP2_HS400_ES (1 << 20) /* Host supports enhanced strobe */ | 311 | #define MMC_CAP2_HS400_ES (1 << 20) /* Host supports enhanced strobe */ |
312 | #define MMC_CAP2_NO_SD (1 << 21) /* Do not send SD commands during initialization */ | ||
312 | 313 | ||
313 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 314 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
314 | 315 | ||