Skip to content

Commit

Permalink
mmc: core: Extend sysfs with OCR register
Browse files Browse the repository at this point in the history
Registers CID and CSD are already exported through sysfs so let's make
this interface complete by adding missing OCR register.

Signed-off-by: Bojan Prtvar <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Bojan Prtvar authored and storulf committed Jul 25, 2016
1 parent 1883edd commit 5fb06af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/mmc/mmc-dev-attrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All attributes are read-only.
preferred_erase_size Preferred erase size
raw_rpmb_size_mult RPMB partition size
rel_sectors Reliable write sector count
ocr Operation Conditions Register

Note on Erase Size and Preferred Erase Size:

Expand Down
2 changes: 2 additions & 0 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
MMC_DEV_ATTR(ocr, "%08x\n", card->ocr);

static ssize_t mmc_fwrev_show(struct device *dev,
struct device_attribute *attr,
Expand Down Expand Up @@ -784,6 +785,7 @@ static struct attribute *mmc_std_attrs[] = {
&dev_attr_enhanced_area_size.attr,
&dev_attr_raw_rpmb_size_mult.attr,
&dev_attr_rel_sectors.attr,
&dev_attr_ocr.attr,
NULL,
};
ATTRIBUTE_GROUPS(mmc_std);
Expand Down
2 changes: 2 additions & 0 deletions drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid);
MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
MMC_DEV_ATTR(ocr, "%08x\n", card->ocr);


static struct attribute *sd_std_attrs[] = {
Expand All @@ -690,6 +691,7 @@ static struct attribute *sd_std_attrs[] = {
&dev_attr_name.attr,
&dev_attr_oemid.attr,
&dev_attr_serial.attr,
&dev_attr_ocr.attr,
NULL,
};
ATTRIBUTE_GROUPS(sd_std);
Expand Down

0 comments on commit 5fb06af

Please sign in to comment.