aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2012-12-04 06:36:19 -0500
committerChris Ball <cjb@laptop.org>2013-02-11 12:51:23 -0500
commit41875e388401ad97c33252d5fa39d52e0b70ee9b (patch)
tree2f76e0c6660f00920589fde0fed7489d30008523 /drivers/mmc/core/sdio.c
parent51aa66a58494f869f491eedda86c409c50536c14 (diff)
mmc: sdio: Fix SDIO 3.0 UHS-I initialization sequence
According to UHS-I initialization sequence for SDIO 3.0 cards, the host must set bit[24] (S18R) of OCR register during OCR handshake to know whether the SDIO card is capable of doing 1.8V I/O. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Johan Rudholm <johan.rudholm@stericsson.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 34ad4c877c1f..9565d38d91a4 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -157,10 +157,7 @@ static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
157 if (ret) 157 if (ret)
158 goto out; 158 goto out;
159 159
160 if (card->host->caps & 160 if (mmc_host_uhs(card->host)) {
161 (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
162 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
163 MMC_CAP_UHS_DDR50)) {
164 if (data & SDIO_UHS_DDR50) 161 if (data & SDIO_UHS_DDR50)
165 card->sw_caps.sd3_bus_mode 162 card->sw_caps.sd3_bus_mode
166 |= SD_MODE_UHS_DDR50; 163 |= SD_MODE_UHS_DDR50;
@@ -478,8 +475,7 @@ static int sdio_set_bus_speed_mode(struct mmc_card *card)
478 * If the host doesn't support any of the UHS-I modes, fallback on 475 * If the host doesn't support any of the UHS-I modes, fallback on
479 * default speed. 476 * default speed.
480 */ 477 */
481 if (!(card->host->caps & (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | 478 if (!mmc_host_uhs(card->host))
482 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_DDR50)))
483 return 0; 479 return 0;
484 480
485 bus_speed = SDIO_SPEED_SDR12; 481 bus_speed = SDIO_SPEED_SDR12;
@@ -645,11 +641,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
645 * systems that claim 1.8v signalling in fact do not support 641 * systems that claim 1.8v signalling in fact do not support
646 * it. 642 * it.
647 */ 643 */
648 if ((ocr & R4_18V_PRESENT) && 644 if ((ocr & R4_18V_PRESENT) && mmc_host_uhs(host)) {
649 (host->caps &
650 (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
651 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
652 MMC_CAP_UHS_DDR50))) {
653 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 645 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
654 true); 646 true);
655 if (err) { 647 if (err) {
@@ -1022,6 +1014,10 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
1022 goto out; 1014 goto out;
1023 } 1015 }
1024 1016
1017 if (mmc_host_uhs(host))
1018 /* to query card if 1.8V signalling is supported */
1019 host->ocr |= R4_18V_PRESENT;
1020
1025 ret = mmc_sdio_init_card(host, host->ocr, host->card, 1021 ret = mmc_sdio_init_card(host, host->ocr, host->card,
1026 mmc_card_keep_power(host)); 1022 mmc_card_keep_power(host));
1027 if (!ret && host->sdio_irqs) 1023 if (!ret && host->sdio_irqs)
@@ -1087,6 +1083,10 @@ int mmc_attach_sdio(struct mmc_host *host)
1087 /* 1083 /*
1088 * Detect and init the card. 1084 * Detect and init the card.
1089 */ 1085 */
1086 if (mmc_host_uhs(host))
1087 /* to query card if 1.8V signalling is supported */
1088 host->ocr |= R4_18V_PRESENT;
1089
1090 err = mmc_sdio_init_card(host, host->ocr, NULL, 0); 1090 err = mmc_sdio_init_card(host, host->ocr, NULL, 0);
1091 if (err) { 1091 if (err) {
1092 if (err == -EAGAIN) { 1092 if (err == -EAGAIN) {