mmc: core: Extend sysfs with OCR register
authorBojan Prtvar <prtvar.b@gmail.com>
Mon, 4 Jul 2016 11:56:55 +0000 (13:56 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 25 Jul 2016 08:34:48 +0000 (10:34 +0200)
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 <prtvar.b@gmail.com>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Documentation/mmc/mmc-dev-attrs.txt
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c

index caa555706f8931dddf8cab3c88763b42d3d2c4d8..8163eca8522b2052d70973098cd404b195547dc4 100644 (file)
@@ -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:
 
index 5485040245876a93ca0f5433f4c91c99ee4ccb2d..403b97b00bd5c5e1d450859dd2e995133d5220f6 100644 (file)
@@ -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,
@@ -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);
index b95bd24d92f415f4c8da8d622da62be6e6a61b5e..3dd0861f45578ccf95d20b90fc3a7c4e49d9053f 100644 (file)
@@ -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[] = {
@@ -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);