bdk: sdmmc: add driver type set support

This commit is contained in:
CTCaer
2023-03-31 09:04:10 +03:00
parent d258c82d52
commit f4bf48e76a
3 changed files with 32 additions and 0 deletions

View File

@@ -297,6 +297,13 @@ static void _sdmmc_reset_all(sdmmc_t *sdmmc)
;
}
void sdmmc_setup_drv_type(sdmmc_t *sdmmc, u32 type)
{
sdmmc->regs->hostctl2 = (sdmmc->regs->hostctl2 & (~SDHCI_CTRL_DRV_TYPE_MASK)) | SDHCI_CTRL_DRV_TYPE(type);
_sdmmc_commit_changes(sdmmc);
}
int sdmmc_setup_clock(sdmmc_t *sdmmc, u32 type)
{
// Disable the SD clock if it was enabled, and reenable it later.