aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index bd7bacc950dc..2c7c83f832d2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -98,10 +98,11 @@ fail:
98 return ret; 98 return ret;
99} 99}
100 100
101static int sdio_read_cccr(struct mmc_card *card) 101static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
102{ 102{
103 int ret; 103 int ret;
104 int cccr_vsn; 104 int cccr_vsn;
105 int uhs = ocr & R4_18V_PRESENT;
105 unsigned char data; 106 unsigned char data;
106 unsigned char speed; 107 unsigned char speed;
107 108
@@ -149,7 +150,7 @@ static int sdio_read_cccr(struct mmc_card *card)
149 card->scr.sda_spec3 = 0; 150 card->scr.sda_spec3 = 0;
150 card->sw_caps.sd3_bus_mode = 0; 151 card->sw_caps.sd3_bus_mode = 0;
151 card->sw_caps.sd3_drv_type = 0; 152 card->sw_caps.sd3_drv_type = 0;
152 if (cccr_vsn >= SDIO_CCCR_REV_3_00) { 153 if (cccr_vsn >= SDIO_CCCR_REV_3_00 && uhs) {
153 card->scr.sda_spec3 = 1; 154 card->scr.sda_spec3 = 1;
154 ret = mmc_io_rw_direct(card, 0, 0, 155 ret = mmc_io_rw_direct(card, 0, 0,
155 SDIO_CCCR_UHS, 0, &data); 156 SDIO_CCCR_UHS, 0, &data);
@@ -584,6 +585,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
584 * Inform the card of the voltage 585 * Inform the card of the voltage
585 */ 586 */
586 if (!powered_resume) { 587 if (!powered_resume) {
588 /* The initialization should be done at 3.3 V I/O voltage. */
589 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
590
587 err = mmc_send_io_op_cond(host, host->ocr, &ocr); 591 err = mmc_send_io_op_cond(host, host->ocr, &ocr);
588 if (err) 592 if (err)
589 goto err; 593 goto err;
@@ -712,7 +716,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
712 /* 716 /*
713 * Read the common registers. 717 * Read the common registers.
714 */ 718 */
715 err = sdio_read_cccr(card); 719 err = sdio_read_cccr(card, ocr);
716 if (err) 720 if (err)
717 goto remove; 721 goto remove;
718 722
@@ -995,6 +999,11 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
995 * With these steps taken, mmc_select_voltage() is also required to 999 * With these steps taken, mmc_select_voltage() is also required to
996 * restore the correct voltage setting of the card. 1000 * restore the correct voltage setting of the card.
997 */ 1001 */
1002
1003 /* The initialization should be done at 3.3 V I/O voltage. */
1004 if (!mmc_card_keep_power(host))
1005 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
1006
998 sdio_reset(host); 1007 sdio_reset(host);
999 mmc_go_idle(host); 1008 mmc_go_idle(host);
1000 mmc_send_if_cond(host, host->ocr_avail); 1009 mmc_send_if_cond(host, host->ocr_avail);