From 9ee4566b4d72df80eb5b021e0ae0fca7f95540b3 Mon Sep 17 00:00:00 2001 From: wanggang26 Date: Mon, 14 Oct 2024 16:08:45 +0800 Subject: [PATCH] mmcsd:add reset card to idle state (CMD0) support Signed-off-by: wanggang26 --- drivers/mmcsd/mmcsd_sdio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index 93bfa5a0e4..8cf5c72081 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -3365,6 +3365,12 @@ static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv, opcode = ic_ptr->opcode & MMCSD_CMDIDX_MASK; switch (opcode) { + case MMCSD_CMDIDX0: /* Reset card to idle state */ + { + mmcsd_sendcmdpoll(priv, MMCSD_CMD0, ic_ptr->arg); + MMCSD_USLEEP(MMCSD_IDLE_DELAY); + } + break; case MMCSD_CMDIDX2: /* Get cid reg data */ { memcpy((FAR void *)(uintptr_t)ic_ptr->data_ptr,