[v2, 7/8] mmc: sd: set 4bit bus width after IO signal voltage switching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



IO signal voltage switching is used for UHS speed mode. After the
voltage switching, the card is in UHS mode and it's needed to
set 4bit bus width before any data transfer command.

Signed-off-by: Yangbo Lu <yangbo.lu@xxxxxxxxxxxxx>
---
 drivers/mmc/core/sd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index e28ebf3..d861ee0 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -947,6 +947,15 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
 			goto free_card;
 	}
 
+	/* If the signal voltage was switched to 1.8v for UHS mode,
+	 * it's needed to set 4bit bus width for card and host.
+	 */
+	if (host->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
+		if (mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4))
+			goto free_card;
+		mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
+	}
+
 	err = mmc_sd_setup_card(host, card, oldcard != NULL);
 	if (err)
 		goto free_card;
-- 
2.1.0.27.g96db324

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux