summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2012-03-13 05:19:13 -0400
committerChris Ball <cjb@laptop.org>2012-03-27 12:20:07 -0400
commit83bb24aaa4af2ec7c127cc2a5fa7ca9f64cdd13d (patch)
treefa7d97909c26a8906c6c97947a0f7ea25f3f2288
parent2cecdf002300bca86ce83b17a60f907d5a4ce7dc (diff)
downloadlinux-83bb24aaa4af2ec7c127cc2a5fa7ca9f64cdd13d.tar.gz
linux-83bb24aaa4af2ec7c127cc2a5fa7ca9f64cdd13d.tar.bz2
linux-83bb24aaa4af2ec7c127cc2a5fa7ca9f64cdd13d.zip
mmc: core: add high-capacity erase size capability flag
Let drivers specify the use of high-capacity erase size. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/mmc.c3
-rw-r--r--include/linux/mmc/host.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index d7d8a93c3503..02914d609a91 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -952,7 +952,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* If enhanced_area_en is TRUE, host needs to enable ERASE_GRP_DEF
* bit. This bit will be lost every time after a reset or power off.
*/
- if (card->ext_csd.enhanced_area_en) {
+ if (card->ext_csd.enhanced_area_en ||
+ (card->ext_csd.rev >= 3 && (host->caps2 & MMC_CAP2_HC_ERASE_SZ))) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_ERASE_GROUP_DEF, 1,
card->ext_csd.generic_cmd6_time);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e05bd241c676..33a4d08d810e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -236,6 +236,7 @@ struct mmc_host {
MMC_CAP2_HS200_1_2V_SDR)
#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
+#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
mmc_pm_flag_t pm_caps; /* supported pm features */
unsigned int power_notify_type;