diff options
author | Toshi Kani <toshi.kani@hpe.com> | 2016-04-25 17:34:58 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-04-26 17:45:18 -0400 |
commit | 5ad9a7fde07a95b326da9e650b4f0a41b85e47b5 (patch) | |
tree | 7e921a398d204492d519c03fff0e4f6a7552bef0 | |
parent | 8804f2525a56261b93576a1900185ac2691d138a (diff) |
acpi/nfit: Update nfit driver to comply with ACPI 6.1
ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure
as follows.
- Valid Fields, Manufacturing Location, and Manufacturing Date
are added from reserved range. No change in the structure size.
- IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
format). The spec clarifies that they need to be represented
as arrays of bytes as well.
This patch makes the following changes to support this update.
- Change the NFIT driver to show SPD ID values in big-endian
format.
- Change sprintf format to use "0x" instead of "#" since "%#02x"
does not prepend '0'.
link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Robert Elliott <elliott@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/acpi/nfit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index d0f35e63640b..5dc243c65dee 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c | |||
@@ -816,7 +816,7 @@ static ssize_t vendor_show(struct device *dev, | |||
816 | { | 816 | { |
817 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); | 817 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); |
818 | 818 | ||
819 | return sprintf(buf, "%#x\n", dcr->vendor_id); | 819 | return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->vendor_id)); |
820 | } | 820 | } |
821 | static DEVICE_ATTR_RO(vendor); | 821 | static DEVICE_ATTR_RO(vendor); |
822 | 822 | ||
@@ -825,7 +825,7 @@ static ssize_t rev_id_show(struct device *dev, | |||
825 | { | 825 | { |
826 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); | 826 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); |
827 | 827 | ||
828 | return sprintf(buf, "%#x\n", dcr->revision_id); | 828 | return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->revision_id)); |
829 | } | 829 | } |
830 | static DEVICE_ATTR_RO(rev_id); | 830 | static DEVICE_ATTR_RO(rev_id); |
831 | 831 | ||
@@ -834,7 +834,7 @@ static ssize_t device_show(struct device *dev, | |||
834 | { | 834 | { |
835 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); | 835 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); |
836 | 836 | ||
837 | return sprintf(buf, "%#x\n", dcr->device_id); | 837 | return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->device_id)); |
838 | } | 838 | } |
839 | static DEVICE_ATTR_RO(device); | 839 | static DEVICE_ATTR_RO(device); |
840 | 840 | ||
@@ -843,7 +843,7 @@ static ssize_t format_show(struct device *dev, | |||
843 | { | 843 | { |
844 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); | 844 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); |
845 | 845 | ||
846 | return sprintf(buf, "%#x\n", dcr->code); | 846 | return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->code)); |
847 | } | 847 | } |
848 | static DEVICE_ATTR_RO(format); | 848 | static DEVICE_ATTR_RO(format); |
849 | 849 | ||
@@ -852,7 +852,7 @@ static ssize_t serial_show(struct device *dev, | |||
852 | { | 852 | { |
853 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); | 853 | struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); |
854 | 854 | ||
855 | return sprintf(buf, "%#x\n", dcr->serial_number); | 855 | return sprintf(buf, "0x%08x\n", be32_to_cpu(dcr->serial_number)); |
856 | } | 856 | } |
857 | static DEVICE_ATTR_RO(serial); | 857 | static DEVICE_ATTR_RO(serial); |
858 | 858 | ||