sdhc: spi: wait for VDD stable before clocking

The SD physical layer specification requires that the operating supply
be stable for at least 1 millisecond before providing the required 74
clocks. The maximum VDD ramp time is specified at 35ms, giving a total
minimum delay of 36ms.

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2024-12-09 11:06:04 +10:00 committed by Benjamin Cabé
parent a16bfb39ff
commit a1ad0ad6c6

View file

@ -727,6 +727,12 @@ static int sdhc_spi_set_io(const struct device *dev, struct sdhc_io *ios)
return -EIO;
}
/* Wait until VDD is stable. Per the spec:
* Maximum VDD rise time of 35ms.
* Minimum 1ms VDD stable time.
*/
k_sleep(K_MSEC(36));
LOG_INF("Powered up");
}