mmc: add prv , sec_count and rev attr for firmware version, revision and capacity check
can be reached via cat /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/prv /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/rev /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/sec_count Change-Id: Ia16ad160ea469a637a1167baef6dcdfc67c8d902 Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/63303 Reviewed-by: Hsuan-Chih Chen <hsuan-chih_chen@asus.com> Tested-by: Hsuan-Chih Chen <hsuan-chih_chen@asus.com> Reviewed-by: Sam hblee <Sam_hblee@asus.com> Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/67879
This commit is contained in:
committed by
Iliyan Malchev
parent
a1c8bbd881
commit
ad83fbde85
@@ -96,6 +96,7 @@ static int mmc_decode_cid(struct mmc_card *card)
|
|||||||
card->cid.prod_name[3] = UNSTUFF_BITS(resp, 72, 8);
|
card->cid.prod_name[3] = UNSTUFF_BITS(resp, 72, 8);
|
||||||
card->cid.prod_name[4] = UNSTUFF_BITS(resp, 64, 8);
|
card->cid.prod_name[4] = UNSTUFF_BITS(resp, 64, 8);
|
||||||
card->cid.prod_name[5] = UNSTUFF_BITS(resp, 56, 8);
|
card->cid.prod_name[5] = UNSTUFF_BITS(resp, 56, 8);
|
||||||
|
card->cid.prv = UNSTUFF_BITS(resp, 48, 8);
|
||||||
card->cid.serial = UNSTUFF_BITS(resp, 16, 32);
|
card->cid.serial = UNSTUFF_BITS(resp, 16, 32);
|
||||||
card->cid.month = UNSTUFF_BITS(resp, 12, 4);
|
card->cid.month = UNSTUFF_BITS(resp, 12, 4);
|
||||||
card->cid.year = UNSTUFF_BITS(resp, 8, 4) + 1997;
|
card->cid.year = UNSTUFF_BITS(resp, 8, 4) + 1997;
|
||||||
@@ -632,6 +633,9 @@ MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
|
|||||||
MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
|
MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
|
||||||
card->ext_csd.enhanced_area_offset);
|
card->ext_csd.enhanced_area_offset);
|
||||||
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
|
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
|
||||||
|
MMC_DEV_ATTR(sec_count, "0x%x\n", card->ext_csd.sectors);
|
||||||
|
MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
|
||||||
|
MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
|
||||||
|
|
||||||
static struct attribute *mmc_std_attrs[] = {
|
static struct attribute *mmc_std_attrs[] = {
|
||||||
&dev_attr_cid.attr,
|
&dev_attr_cid.attr,
|
||||||
@@ -647,6 +651,9 @@ static struct attribute *mmc_std_attrs[] = {
|
|||||||
&dev_attr_serial.attr,
|
&dev_attr_serial.attr,
|
||||||
&dev_attr_enhanced_area_offset.attr,
|
&dev_attr_enhanced_area_offset.attr,
|
||||||
&dev_attr_enhanced_area_size.attr,
|
&dev_attr_enhanced_area_size.attr,
|
||||||
|
&dev_attr_sec_count.attr,
|
||||||
|
&dev_attr_prv.attr,
|
||||||
|
&dev_attr_rev.attr,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ struct mmc_cid {
|
|||||||
unsigned char hwrev;
|
unsigned char hwrev;
|
||||||
unsigned char fwrev;
|
unsigned char fwrev;
|
||||||
unsigned char month;
|
unsigned char month;
|
||||||
|
unsigned int prv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mmc_csd {
|
struct mmc_csd {
|
||||||
|
|||||||
Reference in New Issue
Block a user