1
0

mmc: core: add mmc_card_can_cmd23

Add a dedicated helper to check for CMD23 support for MMC card, similar
to mmc_host_can_cmd23 for the host, as it is easy to get the check
wrong.

Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
Link: https://lore.kernel.org/r/20250818-mobileye-emmc-for-upstream-4-v4-1-34ecb3995e96@bootlin.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Benoît Monin
2025-08-18 16:02:46 +02:00
committed by Ulf Hansson
parent ff1bd1190e
commit 18f7439fa1
2 changed files with 10 additions and 0 deletions

View File

@@ -1875,6 +1875,15 @@ bool mmc_card_can_secure_erase_trim(struct mmc_card *card)
}
EXPORT_SYMBOL(mmc_card_can_secure_erase_trim);
bool mmc_card_can_cmd23(struct mmc_card *card)
{
return ((mmc_card_mmc(card) &&
card->csd.mmca_vsn >= CSD_SPEC_VER_3) ||
(mmc_card_sd(card) && !mmc_card_ult_capacity(card) &&
card->scr.cmds & SD_SCR_CMD23_SUPPORT));
}
EXPORT_SYMBOL(mmc_card_can_cmd23);
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from,
unsigned int nr)
{

View File

@@ -123,6 +123,7 @@ bool mmc_card_can_trim(struct mmc_card *card);
bool mmc_card_can_discard(struct mmc_card *card);
bool mmc_card_can_sanitize(struct mmc_card *card);
bool mmc_card_can_secure_erase_trim(struct mmc_card *card);
bool mmc_card_can_cmd23(struct mmc_card *card);
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr);
unsigned int mmc_calc_max_discard(struct mmc_card *card);