drivers/mmcsd/mmcsd_sdio.c: fix unable to switch eMMC device to 4-bit bus width mode

All eMMC devices support 4-bit bus width, so we should mark the
device as supporting 4-bit bus width after detecting that the
device type is eMMC.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
This commit is contained in:
Windrow14 2024-08-12 13:09:09 +08:00 committed by Xiang Xiao
parent ce0599f46c
commit 4f7f751d2a

View File

@ -2548,7 +2548,7 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv)
/* Configure the SDIO peripheral */
if ((IS_MMC(priv->type) && ((priv->caps & SDIO_CAPS_1BIT_ONLY) == 0)) ||
if ((IS_MMC(priv->type) && ((priv->caps & SDIO_CAPS_1BIT_ONLY) == 0)) &&
((priv->buswidth & MMCSD_SCR_BUSWIDTH_4BIT) != 0))
{
/* JEDEC specs: A.8.3 Changing the data bus width: 'Bus testing
@ -3500,6 +3500,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
finfo("MMC card detected\n");
priv->type = MMCSD_CARDTYPE_MMC;
priv->buswidth |= MMCSD_SCR_BUSWIDTH_4BIT;
/* Now, check if this is a MMC card/chip that supports block
* addressing