Skip to content

Commit 11e3344

Browse files
danieldegrassecarlescufi
authored andcommitted
sd: enable 4 bit bus width for high speed cards
Enable 4 bit bus width for high speed cards, so that host and card combinations that cannot use UHS mode will still benefit from the speed increase of using 4 data lines. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 8cbd1bb commit 11e3344

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

subsys/sd/sdmmc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,14 @@ static int sdmmc_init_hs(struct sd_card *card)
950950
LOG_ERR("Failed to switch card to HS mode");
951951
return ret;
952952
}
953+
if (card->flags & SD_4BITS_WIDTH) {
954+
/* Raise bus width to 4 bits */
955+
ret = sdmmc_set_bus_width(card, SDHC_BUS_WIDTH4BIT);
956+
if (ret) {
957+
LOG_ERR("Failed to change card bus width to 4 bits");
958+
return ret;
959+
}
960+
}
953961
return 0;
954962
}
955963

0 commit comments

Comments
 (0)