summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2026-08-24 21:39:29 +0100
committerUlf Hansson <ulfh@kernel.org>2026-09-10 13:38:41 +0200
commitddbf084a77740dcb8f46fcd3625d9310d47e197a (patch)
tree06a537c99b953ea7bbfde4ae9e79ce9ad9604e12
parent9d4279dfd43e486abdef5d483fcd368963776846 (diff)
downloadlinux-next-ddbf084a77740dcb8f46fcd3625d9310d47e197a.tar.gz
linux-next-ddbf084a77740dcb8f46fcd3625d9310d47e197a.zip
mmc: rtsx_usb_sdmmc: start card power-up at 3.3V
A UHS session can leave the SD pads and SD18 regulator configured for 1.8V. The power-off path disables card power and suspends the regulator, but does not restore their voltage selection. On the next power-up, this stale state remains until after the MMC core requests its initial signal voltage. Restore the SD pads and SD18 regulator to 3.3V before enabling card power, as the old rts5139 driver did. Tested: StarLite ADL with an RTS5129 tray reader; repeated 1.8V UHS sessions, power cycles, and tray removal/reinsertion. Tested: StarFighter MTL with an RTS5129 trayless reader; repeated 1.8V UHS sessions, power cycles, and card removal/reinsertion. Tested: Both systems re-enumerated the card after every cycle. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
-rw-r--r--drivers/mmc/host/rtsx_usb_sdmmc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index bf37fab233cf..d9b33aa79165 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -980,6 +980,11 @@ static int sd_power_on(struct rtsx_usb_sdmmc *host)
}
dev_dbg(sdmmc_dev(host), "%s\n", __func__);
rtsx_usb_init_cmd(ucr);
+ /* Start SD init at 3.3V, like the old rts5139 driver. */
+ rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, SD_PAD_CTL,
+ SD_IO_USING_1V8, SD_IO_USING_3V3);
+ rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, LDO_POWER_CFG,
+ TUNE_SD18_MASK, TUNE_SD18_3V3);
rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_SHARE_MODE,
CARD_SHARE_MASK, CARD_SHARE_SD);