Skip to content

Commit 8d876bf

Browse files
Zhoujie Wustorulf
Zhoujie Wu
authored andcommitted
mmc: sdhci-xenon: wait 5ms after set 1.8V signal enable
According to SD spec 3.00 3.6.1 signal voltage switch procedure step 6~8, (6) Set 1.8V Signal Enable in the Host Control 2 register. (7) Wait 5ms. 1.8V voltage regulator shall be stable within this period. (8) If 1.8V Signal Enable is cleared by Host Controller, go to step (12). Host should wait 5ms after set 1.8V signal enable bit in Host Control 2 register and check if 1.8V is stable or not. But current code checks this bit right after set it. On some platforms with xenon controller found the bit is cleared right away and host reports "1.8V regulator output did not became stable" and 5ms delay can help. Implement voltage_switch callback for xenon controller to add 5ms delay to make sure the 1.8V signal enable bit is set by controller. Signed-off-by: Zhoujie Wu <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent c4ba0e4 commit 8d876bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/mmc/host/sdhci-xenon.c

+7
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,14 @@ static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
230230
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
231231
}
232232

233+
static void xenon_voltage_switch(struct sdhci_host *host)
234+
{
235+
/* Wait for 5ms after set 1.8V signal enable bit */
236+
usleep_range(5000, 5500);
237+
}
238+
233239
static const struct sdhci_ops sdhci_xenon_ops = {
240+
.voltage_switch = xenon_voltage_switch,
234241
.set_clock = sdhci_set_clock,
235242
.set_power = xenon_set_power,
236243
.set_bus_width = sdhci_set_bus_width,

0 commit comments

Comments
 (0)