From: Namjae Jeon <linkinjeon@gmail.com>
To: cjb@laptop.org, linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Namjae Jeon <linkinjeon@gmail.com>
Subject: [PATCH] mmc : export hw reset function info to user
Date: Mon, 19 Sep 2011 00:20:25 +0900 [thread overview]
Message-ID: <1316359225-2224-1-git-send-email-linkinjeon@gmail.com> (raw)
user app should know whether hw reset function is enable to use it.
so I try to add sysfs file of hw reset function like enhanced area.
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
drivers/mmc/core/mmc.c | 6 ++++++
include/linux/mmc/card.h | 1 +
include/linux/mmc/mmc.h | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 10f5a19..06c3ffc 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -355,6 +355,10 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
card->ext_csd.raw_trim_mult =
ext_csd[EXT_CSD_TRIM_MULT];
if (card->ext_csd.rev >= 4) {
+ /* HW reset function feature support.
+ /* user can know it is enable through sysfs interface.
+ card->ext_csd.raw_hw_reset_function =
+ ext_csd[EXT_CSD_RST_FUNCTION];
/*
* Enhanced area feature support -- check whether the eMMC
* card has the Enhanced area enabled. If so, export enhanced
@@ -499,6 +503,7 @@ MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
card->ext_csd.enhanced_area_offset);
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
+MMC_DEV_ATTR(raw_hw_reset_function, "0x%02x\n", card->ext_csd.raw_hw_reset_function);
static struct attribute *mmc_std_attrs[] = {
&dev_attr_cid.attr,
@@ -514,6 +519,7 @@ static struct attribute *mmc_std_attrs[] = {
&dev_attr_serial.attr,
&dev_attr_enhanced_area_offset.attr,
&dev_attr_enhanced_area_size.attr,
+ &dev_attr_raw_hw_reset_function.attr,
NULL,
};
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index b460fc2..237bceb 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -65,6 +65,7 @@ struct mmc_ext_csd {
unsigned int enhanced_area_size; /* Units: KB */
unsigned int boot_size; /* in bytes */
u8 raw_partition_support; /* 160 */
+ u8 raw_hw_reset_function; /* 162 */
u8 raw_erased_mem_count; /* 181 */
u8 raw_ext_csd_structure; /* 194 */
u8 raw_card_type; /* 196 */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 5a794cb..233c932 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -272,6 +272,7 @@ struct _mmc_csd {
#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
+#define EXT_CSD_RST_FUNCTION 162 /* R/W */
#define EXT_CSD_WR_REL_PARAM 166 /* RO */
#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
#define EXT_CSD_PART_CONFIG 179 /* R/W */
--
1.7.4.4
next reply other threads:[~2011-09-18 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-18 15:20 Namjae Jeon [this message]
2011-09-19 16:19 ` Andrei Warkentin
2011-09-19 23:51 ` NamJae Jeon
2011-09-20 12:21 ` Adrian Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316359225-2224-1-git-send-email-linkinjeon@gmail.com \
--to=linkinjeon@gmail.com \
--cc=cjb@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®