From 54eb0f19da414f38c250b9f3391f5d49d0c0b643 Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 27 Oct 2026 13:52:19 -0700 Subject: [PATCH] Remove tsd_sdhci_deinit, since init resets the controller --- include/tinysd/host/sdhci.h | 7 ------- src/host/sdhci.c | 17 ----------------- 2 files changed, 24 deletions(-) diff --git a/include/tinysd/host/sdhci.h b/include/tinysd/host/sdhci.h index 3a10391..cd4bbe2 100644 --- a/include/tinysd/host/sdhci.h +++ b/include/tinysd/host/sdhci.h @@ -53,10 +53,3 @@ struct tsd_sdhci { * @return 0 or a negative tsd_error */ int tsd_sdhci_init(struct tsd_sdhci *sdhci, struct tsd_sdhci_config config); - -/** - * Deinitialize an SDHCI host. - * - * @param sdhci the controller - */ -void tsd_sdhci_deinit(struct tsd_sdhci *sdhci); diff --git a/src/host/sdhci.c b/src/host/sdhci.c index ba6b6df..bbe2f51 100644 --- a/src/host/sdhci.c +++ b/src/host/sdhci.c @@ -809,20 +809,3 @@ int tsd_sdhci_init(struct tsd_sdhci *sdhci, struct tsd_sdhci_config config) return 0; } - -void tsd_sdhci_deinit(struct tsd_sdhci *sdhci) -{ - // Reset the whole controller, which clears the clock, the bus power, the host control and the interrupt enables - reset_controller(sdhci, RESET_ALL); - sdhci->card_interrupt = false; - - // Write them again for a controller that kept any, and clear every pending status - write16(sdhci, REG_CLOCK, 0); - write8(sdhci, REG_POWER, 0); - write8(sdhci, REG_CTRL, 0); - write16(sdhci, REG_INT_ENABLE, 0); - write16(sdhci, REG_INT_ENABLE + 2, 0); - write16(sdhci, REG_INT_SIGNAL, 0); - write16(sdhci, REG_INT_SIGNAL + 2, 0); - write32(sdhci, REG_INT_STATUS, INT_ALL); -}