summaryrefslogtreecommitdiffstats
path: root/drivers/mci/sdhci.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-08-03 12:49:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-11-06 08:43:42 +0100
commit02c4e19825076e0ceb43b88b115cffff9c6067bf (patch)
tree9a5b9ffe43365b5a5d8ddb35b55546b45d2a0c1a /drivers/mci/sdhci.c
parent3ad695e291b7b9c9c7b5ac5f0d80be7b8d930cde (diff)
downloadbarebox-02c4e19825076e0ceb43b88b115cffff9c6067bf.tar.gz
barebox-02c4e19825076e0ceb43b88b115cffff9c6067bf.tar.xz
mci: sdhci: wait for idle before stopping clock
We should wait for the controller being idle before stopping the clock. Some SDHCI controllers like the one found on TI AM62x SoCs do not work properly without it. Link: https://lore.barebox.org/20230803105003.4088205-16-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/sdhci.c')
-rw-r--r--drivers/mci/sdhci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index 169324ab1d..edb819d66d 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -567,6 +567,8 @@ void sdhci_set_clock(struct sdhci *host, unsigned int clock, unsigned int input_
host->mci->clock = 0;
+ sdhci_wait_idle(host, NULL);
+
sdhci_write16(host, SDHCI_CLOCK_CONTROL, 0);
if (clock == 0)