diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-04-29 19:33:23 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-04-30 01:28:07 +0200 |
commit | 6ca7208569550de43d64db6cf873706c371284a5 (patch) | |
tree | 352bbb1f74901711e9bf06452bda438bc381809e /drivers/acpi | |
parent | nfit: fix format interface code byte order per ACPI6.1 (diff) | |
download | linux-6ca7208569550de43d64db6cf873706c371284a5.tar.xz linux-6ca7208569550de43d64db6cf873706c371284a5.zip |
nfit: export subsystem ids as attributes
Similar to pci-sysfs export the subsystem information available in the
NFIT. ACPI 6.1 clarifies that this data is copied as an array of bytes
from the DIMM SPD data.
Reported-by: Ryon Jensen <ryon.jensen@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/nfit.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index 5a7199db2e06..0a1ba3d2e39a 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c @@ -847,6 +847,34 @@ static ssize_t format_show(struct device *dev, } static DEVICE_ATTR_RO(format); +static ssize_t subsystem_vendor_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); + + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->subsystem_vendor_id)); +} +static DEVICE_ATTR_RO(subsystem_vendor); + +static ssize_t subsystem_rev_id_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); + + return sprintf(buf, "0x%04x\n", + be16_to_cpu(dcr->subsystem_revision_id)); +} +static DEVICE_ATTR_RO(subsystem_rev_id); + +static ssize_t subsystem_device_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); + + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->subsystem_device_id)); +} +static DEVICE_ATTR_RO(subsystem_device); + static ssize_t serial_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -893,9 +921,12 @@ static struct attribute *acpi_nfit_dimm_attributes[] = { &dev_attr_phys_id.attr, &dev_attr_vendor.attr, &dev_attr_device.attr, + &dev_attr_rev_id.attr, + &dev_attr_subsystem_vendor.attr, + &dev_attr_subsystem_device.attr, + &dev_attr_subsystem_rev_id.attr, &dev_attr_format.attr, &dev_attr_serial.attr, - &dev_attr_rev_id.attr, &dev_attr_flags.attr, &dev_attr_id.attr, NULL, |