aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-17 08:09:42 -0400
committerJean Delvare <jdelvare@suse.de>2018-06-17 08:09:42 -0400
commitb23908d3c48a37c46c6a26df2cdeab1610b360ba (patch)
tree0019944e2aa3abc4b752127e9a13a6936e95ad9a
parent29dcea88779c856c7dc92040a0c01233263101d4 (diff)
firmware: dmi: Add access to the SKU ID string
This is used in some systems from user space for determining the identity of the device. Expose this as a file so that that user-space tools don't need to read from /sys/firmware/dmi/tables/DMI Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--drivers/firmware/dmi-id.c2
-rw-r--r--drivers/firmware/dmi_scan.c1
-rw-r--r--include/linux/mod_devicetable.h1
3 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 951b6c79f166..624a11cb07e2 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -47,6 +47,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME);
47DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION); 47DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
48DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL); 48DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
49DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID); 49DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);
50DEFINE_DMI_ATTR_WITH_SHOW(product_sku, 0444, DMI_PRODUCT_SKU);
50DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY); 51DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY);
51DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR); 52DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);
52DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME); 53DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);
@@ -193,6 +194,7 @@ static void __init dmi_id_init_attr_table(void)
193 ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL); 194 ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL);
194 ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID); 195 ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID);
195 ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY); 196 ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY);
197 ADD_DMI_ATTR(product_sku, DMI_PRODUCT_SKU);
196 ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR); 198 ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR);
197 ADD_DMI_ATTR(board_name, DMI_BOARD_NAME); 199 ADD_DMI_ATTR(board_name, DMI_BOARD_NAME);
198 ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION); 200 ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION);
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 54e66adef252..f2483548cde9 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -447,6 +447,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
447 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); 447 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
448 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7); 448 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
449 dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8); 449 dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
450 dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
450 dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26); 451 dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
451 break; 452 break;
452 case 2: /* Base Board Information */ 453 case 2: /* Base Board Information */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7d361be2e24f..61fbfbc03e5b 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -490,6 +490,7 @@ enum dmi_field {
490 DMI_PRODUCT_VERSION, 490 DMI_PRODUCT_VERSION,
491 DMI_PRODUCT_SERIAL, 491 DMI_PRODUCT_SERIAL,
492 DMI_PRODUCT_UUID, 492 DMI_PRODUCT_UUID,
493 DMI_PRODUCT_SKU,
493 DMI_PRODUCT_FAMILY, 494 DMI_PRODUCT_FAMILY,
494 DMI_BOARD_VENDOR, 495 DMI_BOARD_VENDOR,
495 DMI_BOARD_NAME, 496 DMI_BOARD_NAME,