LF-3483-16 mmc: fix device_remove when HS400_ES is enabled
authorYe Li <ye.li@nxp.com>
Wed, 28 Apr 2021 01:19:19 +0000 (18:19 -0700)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 12:06:37 +0000 (05:06 -0700)
HS400_ES is missed when down grade to HS mode when
device_remove the mmc device

Signed-off-by: Ye Li <ye.li@nxp.com>
drivers/mmc/mmc.c

index ae2e611..785ebc0 100644 (file)
@@ -2092,14 +2092,16 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
        }
 
 #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || \
-    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT) || \
+    CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)
        /*
         * In case the eMMC is in HS200/HS400 mode, downgrade to HS mode
         * before doing anything else, since a transition from either of
         * the HS200/HS400 mode directly to legacy mode is not supported.
         */
        if (mmc->selected_mode == MMC_HS_200 ||
-           mmc->selected_mode == MMC_HS_400)
+           mmc->selected_mode == MMC_HS_400 ||
+           mmc->selected_mode == MMC_HS_400_ES)
                mmc_set_card_speed(mmc, MMC_HS, true);
        else
 #endif
@@ -2951,7 +2953,7 @@ int mmc_deinit(struct mmc *mmc)
                return sd_select_mode_and_width(mmc, caps_filtered);
        } else {
                caps_filtered = mmc->card_caps &
-                       ~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400));
+                       ~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_400_ES));
 
                return mmc_select_mode_and_width(mmc, caps_filtered);
        }