Received: by 10.192.165.148 with SMTP id m20csp5123675imm; Tue, 24 Apr 2018 14:12:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Oj2DDSpNj7HPKgpjW3C0DLn/QcDTql/Ix7meniCJaDIUKBj6ZlzyK/T6npv6l9lqkwnXa X-Received: by 2002:a17:902:30f:: with SMTP id 15-v6mr26486806pld.365.1524604353744; Tue, 24 Apr 2018 14:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524604353; cv=none; d=google.com; s=arc-20160816; b=dXjO1qbdiH6QXvi9d6bVwaAfJxVwmXiPuAVdxcxlHaAXYmVVEIOLxdjpklnaRbTGqI b+BYqifhfmZgIzOmvJFfyFUavrKL7Fbd79IAtfPjeFmSrEerGyr3OOJf6Stv4xfh8brg TKpAUM8gLJURSv74FR4KBV8BDRISLBoILXB5p0S/p6IBV4Rms96BCqCm3OWR7Td3EXBN LRzlqKEPx4/kwQoX1hJVtSkYVGKJXQEtJuMMHuVM9CX533xYoiXkcF2uZeQHbmBPnDa7 zrlqXLlhVQXfjRtViaUG/xQpEXLHSLPg9tQd40Dsm/eBbinkxNyqt3gRz2J2CKh3O/4J zxOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=+qXB9x8+2GzlvXaG+IZRT7eiIqNk/l1hrph1AflcS7I=; b=zPFBDX4vXZSdxeoYnbhjP53pmK4vJhvbh7H2Ly0TTeE8aIaKd0fQe1hDFBIl9xSfNZ vZvv1BoaEMeBIY7xNukKVbanVBrden4lJH76PNST1HaXVBcp/R/MrxkJSHZczOsdLH8Y iWliHXJ1dqsfuGWocH439qsXo3hwev19DTigIEzM/PUw2ad4MsToUnV1Zr6ZlYqRMFnq +cLsCUjxNmNK2HetOFDyH55gtYyxoB6PhsOTF35vu6kenRanCHpm/LFHa5uUCbNVCj2w kcG28WkVd9BXFgAXHzbDhjjVTSfBY6EEfPkBr/427HgKzOzqKCKXm4JXEgW/JoJNFDVW rJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=bRWSxw88; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y188si11411119pgb.622.2018.04.24.14.12.19; Tue, 24 Apr 2018 14:12:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=bRWSxw88; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbeDXVLR (ORCPT + 99 others); Tue, 24 Apr 2018 17:11:17 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:33691 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbeDXVLQ (ORCPT ); Tue, 24 Apr 2018 17:11:16 -0400 Received: by mail-it0-f67.google.com with SMTP id x144-v6so13489098itc.0 for ; Tue, 24 Apr 2018 14:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=+qXB9x8+2GzlvXaG+IZRT7eiIqNk/l1hrph1AflcS7I=; b=bRWSxw88dGKFl6dYR+24cwQxoFvjgdz1ctAnE1UgLWMAD+bDtDDQLiLRLenjNe0F23 w1KWrAMHZYwCAhQ/LPRfVwtQLow+5vEtFJb9UYrkgJtw5f+TOM/6F/A13m+Nc+SL2Th9 Hj5zc4qhD1ehanbU41b7UisSuthgWUxHbZSPKRa0LyBRh3Ma9CDsGIW7I7P7TAdFamRg UezkaAL2ru0I+MzidGzt4/1tv4lxYHmEXcsWZhgOfZU6CRqhGBtLisuQEF8xL86SvjiV Av9OC5OY2XmZIZdCGAbtY5/zUeJv5yNNG1grtvGCy7qj/jr+VdPTrC1ViziGHJT5QkPM 1Mkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=+qXB9x8+2GzlvXaG+IZRT7eiIqNk/l1hrph1AflcS7I=; b=RX5pUwn3AE3W2PbGz5zAB4MNxXHZ38HlzdSM5pmmWcUfXiDxpDLDQbG+4AjghfJX8/ sQNgcmXTMj1y73v6Zd7ESAWsjTZ4/ObgRdPPqPBi7FSnJAipyDhMHwpV3mFqmc+PkO5c EG6iWNcaR26b7YnbQxRJOAU81U+Lkq5tOqXQRHrEo/yBYExWnZR3npW3SVuvI1Nl4Lx6 owRCpviSCVqOABfsv15OKFrXNsRCBKWCRY5/qdymtK53zTXU1joygCk2MiGJyynZ53Rf 7DeussLIt64NxFOV8SygBdqBsbAgkzrGMivSGT0SygXNdh3wWYDwOiGomfWHtNzl/+YW /q/g== X-Gm-Message-State: ALQs6tCo5P/JwgSJPSqEkR1IfuCEawU5eUmYwTOA8igOVMycvOXjllHw kP8LwpQKJSovXkCDC4NCcK1yJg== X-Received: by 2002:a24:fdc9:: with SMTP id m192-v6mr1042688ith.95.1524604274896; Tue, 24 Apr 2018 14:11:14 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([100.67.80.24]) by smtp.gmail.com with ESMTPSA id p125-v6sm5940768ita.26.2018.04.24.14.11.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 14:11:14 -0700 (PDT) Received: by kiwi.bld.corp.google.com (Postfix, from userid 121222) id 1E35E140D73; Tue, 24 Apr 2018 15:11:12 -0600 (MDT) From: Simon Glass To: LKML Cc: C Shapiro , Aaron Durbin , Simon Glass , Mika Westerberg , Jonathan Corbet , Philippe Ombredanne , Andy Shevchenko , Alex Hung , Dmitry Torokhov , Greg Kroah-Hartman , Jean Delvare , sayli karnik , Vinod Koul , Sagar Dharia Subject: [PATCH] firmware: dmi: Add access to the SKU ID string Date: Tue, 24 Apr 2018 15:11:11 -0600 Message-Id: <20180424211111.140374-1-sjg@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/firmware/dmi-id.c | 2 ++ drivers/firmware/dmi_scan.c | 1 + include/linux/mod_devicetable.h | 1 + 3 files changed, 4 insertions(+) diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index 951b6c79f166a..fe78c7f801163 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -48,6 +48,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION); DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL); DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID); DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY); +DEFINE_DMI_ATTR_WITH_SHOW(product_sku, 0444, DMI_PRODUCT_SKU); DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR); DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME); DEFINE_DMI_ATTR_WITH_SHOW(board_version, 0444, DMI_BOARD_VERSION); @@ -193,6 +194,7 @@ static void __init dmi_id_init_attr_table(void) ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL); ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID); ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY); + ADD_DMI_ATTR(product_sku, DMI_PRODUCT_SKU); ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR); ADD_DMI_ATTR(board_name, DMI_BOARD_NAME); ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION); diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 54e66adef2525..f2483548cde92 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) dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7); dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8); + dmi_save_ident(dm, DMI_PRODUCT_SKU, 25); dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26); break; case 2: /* Base Board Information */ diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 7d361be2e24f4..cb8487e29d3ae 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -491,6 +491,7 @@ enum dmi_field { DMI_PRODUCT_SERIAL, DMI_PRODUCT_UUID, DMI_PRODUCT_FAMILY, + DMI_PRODUCT_SKU, DMI_BOARD_VENDOR, DMI_BOARD_NAME, DMI_BOARD_VERSION, -- 2.17.0.484.g0c8726318c-goog