Skip to content

Commit a1ad0ad

Browse files
JordanYateskartben
authored andcommitted
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 <[email protected]>
1 parent a16bfb3 commit a1ad0ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/sdhc/sdhc_spi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,12 @@ static int sdhc_spi_set_io(const struct device *dev, struct sdhc_io *ios)
727727
return -EIO;
728728
}
729729

730+
/* Wait until VDD is stable. Per the spec:
731+
* Maximum VDD rise time of 35ms.
732+
* Minimum 1ms VDD stable time.
733+
*/
734+
k_sleep(K_MSEC(36));
735+
730736
LOG_INF("Powered up");
731737
}
732738

0 commit comments

Comments
 (0)