summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2011-10-18 09:34:04 +0900
committerChris Ball <cjb@laptop.org>2011-10-26 16:32:27 -0400
commitb3bf915308ca2b50f3beec6cc824083870f0f4b5 (patch)
tree955978242b333e1388358b4b50b5f8f4a5abca04 /drivers/mmc/core/core.c
parentd9ddd62943ee07a75d0428ffcf52f1a747a28c39 (diff)
mmc: core: new discard feature support at eMMC v4.5
MMC v4.5 supports the DISCARD feature (CMD38). It's different from trim and there's no check bit. Currently it's only supported at v4.5. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r--drivers/mmc/core/core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index d9836e5a4e59..772de2cdfd1d 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1709,10 +1709,24 @@ int mmc_can_trim(struct mmc_card *card)
{
if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN)
return 1;
+ if (mmc_can_discard(card))
+ return 1;
return 0;
}
EXPORT_SYMBOL(mmc_can_trim);
+int mmc_can_discard(struct mmc_card *card)
+{
+ /*
+ * As there's no way to detect the discard support bit at v4.5
+ * use the s/w feature support filed.
+ */
+ if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE)
+ return 1;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_can_discard);
+
int mmc_can_sanitize(struct mmc_card *card)
{
if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE)