mmc: core: Extend sysfs with OCR register
Subsystems (2)
PATCH 1/1 mmc: core: Extend sysfs with OCR register
Make operation conditions register (OCR) easily accessible from user space.
--- Documentation/mmc/mmc-dev-attrs.txt | 1 + drivers/mmc/core/mmc.c | 2 ++ 2 files changed, 3 insertions(+)
Documentation/mmc/mmc-dev-attrs.txt +1 -0
@@ -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:
drivers/mmc/core/mmc.c +2 -0
@@ -727,6 +727,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,
@@ -762,6 +763,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);
Signature · 1 line
2.8.0.GIT
Bojan,
Quoted 3 lines · Bojan Prtvar
Make operation conditions register (OCR) easily accessible from user space.
Signed-off-by Bojan Prtvar <[email protected]>
You described "what" above. Can you add the "why", too?
Regards,
Wolfram
Hi,
Quoted 4 lines · Wolfram Sang
Quoted 2 lines
Make operation conditions register (OCR) easily accessible from user space.
You described "what" above. Can you add the "why", too?
According to JEDEC v5.0 chapter 7 the OCR, CID and CSD registers carry the Device/content specific information.
Registers CID and CSD are already exported through sysfs so let's make this interface complete by adding missing OCR register.
Do I need to send v2 with updated change log?
Regards,
Bojan
Quoted 3 lines
Registers CID and CSD are already exported through sysfs so let's make this interface complete by adding missing OCR register.
This sentence was missing for me, thanks.
Quoted 1 line
Do I need to send v2 with updated change log?
Ulf will tell us.
Ulf Hansson
AppliedQuoted 3 lines · Bojan Prtvar
Make operation conditions register (OCR) easily accessible from user space.
Signed-off-by Bojan Prtvar <[email protected]>
Thanks, applied for next! Amended the changelog with the explanation why this change is wanted.
Kind regards
Uffe
Quoted 40 lines
--- Documentation/mmc/mmc-dev-attrs.txt | 1 + drivers/mmc/core/mmc.c | 2 ++ 2 files changed, 3 insertions(+)Documentation/mmc/mmc-dev-attrs.txt +1
-0@@ -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:drivers/mmc/core/mmc.c +2
-1@@ -727,6 +727,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,@@ -762,6 +763,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); --2.8.0.GIT
Quoted 7 lines · Ulf Hansson
Quoted 3 lines · Bojan Prtvar
Make operation conditions register (OCR) easily accessible from user space.
Signed-off-by Bojan Prtvar <[email protected]>Thanks, applied for next! Amended the changelog with the explanation why this change is wanted.
I just realized that the OCR register is also available for SD cards.
Could you perhaps cook a patch which adds this to sysfs for SD cards as well!?
Kind regards
Uffe
Quoted 44 lines
Kind regards
UffeQuoted 40 lines
--- Documentation/mmc/mmc-dev-attrs.txt | 1 + drivers/mmc/core/mmc.c | 2 ++ 2 files changed, 3 insertions(+)Documentation/mmc/mmc-dev-attrs.txt +1
-0@@ -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:drivers/mmc/core/mmc.c +2
-1@@ -727,6 +727,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,@@ -762,6 +763,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); --2.8.0.GIT
Hi Ulf,
Quoted 4 lines · Ulf Hansson
I just realized that the OCR register is also available for SD cards.
Could you perhaps cook a patch which adds this to sysfs for SD cards as well!?
Sure. I'll do it tomorrow.
Regards,
Bojan