Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions include/tinysd/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
17 changes: 0 additions & 17 deletions src/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Loading