From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D2E33403EA for ; Mon, 13 Jul 2026 05:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783921534; cv=none; b=El7ZMaQPdXj3ULbCoJsT8zChtLkV/LkynEsgkX5pCsdVwxbJOwCnT2LfGNVi3r0djPvIbKcmitezE0ojXUDFHl4AnlIDsjHYkl3BOSDZU9GP5ohIn2LFyB3hzeoKWp5L+gwNqlJA4YrtphKvGFi/XFXu0TDuDWbpBmZgZOxoU1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783921534; c=relaxed/simple; bh=rVddTNpQurkFV/8DFuCmg4zy1L2WiT/Y7kXar/FikM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FOyKEnwnJ6SP1Rk1aQzZ1fM67oIcNKvRxKQAhot0kMrTeS3un0x5jhRxH6ocd40CG7sQY6VxzdtRZ2oJt5XRzwho0ZgahJiK50SgCdcTxdOKknxkKY3gyYfdFMze+p3crojK/MidVlKNqzjVtKgTYdyVg4q7zi1pr8AxdfksfcU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems; spf=pass smtp.mailfrom=starlabs.systems; dkim=pass (2048-bit key) header.d=starlabs-systems.20251104.gappssmtp.com header.i=@starlabs-systems.20251104.gappssmtp.com header.b=Gyq7ZJg6; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starlabs.systems Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=starlabs-systems.20251104.gappssmtp.com header.i=@starlabs-systems.20251104.gappssmtp.com header.b="Gyq7ZJg6" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-47ddf7b09e5so2298321f8f.1 for ; Sun, 12 Jul 2026 22:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20251104.gappssmtp.com; s=20251104; t=1783921531; x=1784526331; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/LqQQoB1fX6fzR6jjKfwof9L5maeAMcnLMeohNysG1U=; b=Gyq7ZJg6IY+5n04+dnzkgFgNm8Ub8w8H4Bch19UooY0bC5Ckgk2R2izhS5ZK8PnTbl Vu3kzTMi84VOWKlKHC399rKdQtPopYHmNJT5iFaIHhT4yJJ+XtxlS85lpzF9zxTIT2Cj pTPZl7ygMRDKJZbIlcILWpZ/+1nrTc5RWJ3Kqh1hLowS7FsdxSSjY3A7ZFflt13OGXkJ lwA1k+BGHX4KnCcrd2Ypq1ZVSjEIDvsd3wUFcdJLz5uoaVtP+uF1ZzsMV31oJ7QNd5Lb 7BNKlQy7VLrFDV1odGBZIUt85xovjPXWJojlQ4vk/aJWEzieOO5vmtFBLkRGas73k/NK Do9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783921531; x=1784526331; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/LqQQoB1fX6fzR6jjKfwof9L5maeAMcnLMeohNysG1U=; b=Me8p814nzJMB2uvPrW4yj4gAd7zFEw9mLOgz9ZANwm2dFcVBwvlWHEFAljpYelEecm cd/w3j9jLIUbUtVsFAIdldoDNWUQQULIbgOyrD2+VH7OcZy/e7BUxAHVuV9RP68fIM9C lAY94QCyFtMrKLS7QqnIPD7mDVy1r7hpD5B67d85Dy+TSvDm+E2gLGljOEN3wqhL/Nhy k2DpOj4bTPsHMsljzI5kmF6J/w9mpW+KIttSLD2cSLM5MOZNV7SHc1BowhzCY0RSjUud loxJGGoMaln3ffG6tLZRgrMVN/ZoTchVHhB+r88+VN6exdLdArxk144McqamFiV+Pnna Yzug== X-Forwarded-Encrypted: i=1; AHgh+RrvTm7HOZmXuSOR8/bW9Ms3B5WZMDQ0UVrUlr8LrRPCISltHEX8UUtevzh32t4xU0U6ni1Ugs5HeH+po/g=@vger.kernel.org X-Gm-Message-State: AOJu0YxnqBUZrJmTnFJ1MsaaZUqQYJUX7+UljLnoGrn1wjZvIsituhTk CHD6KCJGMnVKmbsnMfSRSUdmKb7a5Y2GltizIXfm+x+ej973JHOdtSLmx3Q6WhddRw== X-Gm-Gg: AfdE7cmRfQmrEQsfzWIv2rmlzALVSjAbZeVvzhk7nEUKL7UcwS3MFvQlD+Y6PaRG0b/ 9hXgY2VjbmT7CRwYqSWjOAfXdtQcazSgQIl3IEF+sTeVti9onoRayxH4c3zhd2CY0wZ00sexpn3 2sdXD/sI//MF0mZXLEzOcTG8nb0Sz3iC37nnPgP0DRm17IJHqgfaOEDtBQdt/w0W9IL/E6glSPB WP48XjN1aJn7je1EEblQNuKd81vt21H3tIvR6hljKl5z3wTxhxCgEWv4vehJALxPQfun4TGiEWn cECdXaj0J8ICBMhpvuKweUbS3duQMCVQTKhF02sc1W8oZ7siSfXw970v1LWiLNoajkxI2Rj1/na BsLDZ8BCIivf+pzrRMpkb2nBiSh6kYebr9YgVB/avekfDJlg/ZMwAhaoTXJOL1UAKBX9ttma2/a qqEnteUgY1eWLrnlGyPzCsD3z0SQ81UEivbl3y1sc= X-Received: by 2002:a05:6000:22c5:b0:475:f100:3600 with SMTP id ffacd0b85a97d-47f2dd4f7ffmr8723711f8f.61.1783921530618; Sun, 12 Jul 2026 22:45:30 -0700 (PDT) Received: from horizon ([217.155.46.38]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0f21328sm83474963f8f.32.2026.07.12.22.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 22:45:29 -0700 (PDT) From: Sean Rhodes To: tzungbi@kernel.org Cc: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, corentin.chary@gmail.com, luke@ljones.dev, denis.benato@linux.dev, prasanth.ksr@dell.com, jorge.lopez2@hp.com, mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com, josh@joshuagrisham.com, briannorris@chromium.org, jwerner@chromium.org, tzimmermann@suse.de, javierm@redhat.com, kees@kernel.org, u.kleine-koenig@baylibre.com, mst@redhat.com, chenhuacai@kernel.org, wenst@chromium.org, florian.fainelli@broadcom.com, titouan.ameline@gmail.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Dell.Client.Kernel@dell.com, chrome-platform@lists.linux.dev Subject: [PATCH v5 1/3] firmware: Move firmware attributes class helper Date: Mon, 13 Jul 2026 06:45:24 +0100 Message-ID: <20260713054526.2902319-2-sean@starlabs.systems> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260713054526.2902319-1-sean@starlabs.systems> References: <20260713054526.2902319-1-sean@starlabs.systems> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the firmware attributes class helper from drivers/platform/x86 to drivers/firmware and expose its class declaration through a public Linux header. The helper is not x86-specific. Keeping it in firmware lets coreboot firmware drivers use the standard firmware-attributes ABI without living under platform/x86. Reviewed-by: Mark Pearson Signed-off-by: Sean Rhodes --- MAINTAINERS | 8 ++++++++ drivers/firmware/Kconfig | 3 +++ drivers/firmware/Makefile | 1 + .../x86 => firmware}/firmware_attributes_class.c | 2 +- drivers/platform/x86/Kconfig | 3 --- drivers/platform/x86/Makefile | 2 -- drivers/platform/x86/asus-armoury.c | 2 +- drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 2 +- drivers/platform/x86/lenovo/think-lmi.c | 2 +- drivers/platform/x86/lenovo/wmi-other.c | 2 +- drivers/platform/x86/samsung-galaxybook.c | 2 +- .../linux/firmware_attributes.h | 6 +++--- 13 files changed, 22 insertions(+), 15 deletions(-) rename drivers/{platform/x86 => firmware}/firmware_attributes_class.c (94%) rename drivers/platform/x86/firmware_attributes_class.h => include/linux/firmware_attributes.h (60%) diff --git a/MAINTAINERS b/MAINTAINERS index f37a81950e25..07bdba98b1b1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10114,6 +10114,14 @@ F: include/linux/firewire.h F: include/uapi/linux/firewire*.h F: tools/firewire/ +FIRMWARE ATTRIBUTES CLASS +M: Hans de Goede +M: Ilpo Järvinen +L: platform-driver-x86@vger.kernel.org +S: Maintained +F: drivers/firmware/firmware_attributes_class.c +F: include/linux/firmware_attributes.h + FIRMWARE FRAMEWORK FOR ARMV8-A M: Sudeep Holla L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 12dc70254842..78a239f8bbef 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -8,6 +8,9 @@ menu "Firmware Drivers" source "drivers/firmware/arm_scmi/Kconfig" +config FW_ATTR_CLASS + tristate + config ARM_SCPI_PROTOCOL tristate "ARM System Control and Power Interface (SCPI) Message Protocol" depends on ARM || ARM64 || COMPILE_TEST diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 4ddec2820c96..385b6e8b7fc6 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o obj-$(CONFIG_MTK_ADSP_IPC) += mtk-adsp-ipc.o obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o +obj-$(CONFIG_FW_ATTR_CLASS) += firmware_attributes_class.o obj-$(CONFIG_SYSFB) += sysfb.o obj-$(CONFIG_SYSFB_SIMPLEFB) += sysfb_simplefb.o obj-$(CONFIG_TH1520_AON_PROTOCOL) += thead,th1520-aon.o diff --git a/drivers/platform/x86/firmware_attributes_class.c b/drivers/firmware/firmware_attributes_class.c similarity index 94% rename from drivers/platform/x86/firmware_attributes_class.c rename to drivers/firmware/firmware_attributes_class.c index 736e96c186d9..503ecc288086 100644 --- a/drivers/platform/x86/firmware_attributes_class.c +++ b/drivers/firmware/firmware_attributes_class.c @@ -3,7 +3,7 @@ /* Firmware attributes class helper module */ #include -#include "firmware_attributes_class.h" +#include const struct class firmware_attributes_class = { .name = "firmware-attributes", diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index b54b5212b204..beed14c38b54 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -926,9 +926,6 @@ config DASHARO_ACPI source "drivers/platform/x86/x86-android-tablets/Kconfig" -config FW_ATTR_CLASS - tristate - config INTEL_IMR bool "Intel Isolated Memory Region support" depends on X86_INTEL_QUARK && IOSF_MBI diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index 872ac3842391..cab20a4145e3 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile @@ -63,8 +63,6 @@ obj-$(CONFIG_X86_PLATFORM_DRIVERS_HP) += hp/ # Hewlett Packard Enterprise obj-$(CONFIG_UV_SYSFS) += uv_sysfs.o -obj-$(CONFIG_FW_ATTR_CLASS) += firmware_attributes_class.o - # IBM Thinkpad (before 2005) obj-$(CONFIG_IBM_RTL) += ibm_rtl.o obj-$(CONFIG_SENSORS_HDAPS) += hdaps.o diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c index 495dc1e31d40..93fac0d464d2 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -34,7 +34,7 @@ #include #include "asus-armoury.h" -#include "firmware_attributes_class.h" +#include #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C" diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index ab46a023cc34..85670be01647 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -16,7 +16,7 @@ #include #include #include "dell-wmi-sysman.h" -#include "../../firmware_attributes_class.h" +#include #define MAX_TYPES 4 #include diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index 27fd6cd21529..44314ae4e5e3 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -14,7 +14,7 @@ #include #include #include "bioscfg.h" -#include "../../firmware_attributes_class.h" +#include #include #include diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c index e215e86e3db7..a56f152b5f28 100644 --- a/drivers/platform/x86/lenovo/think-lmi.c +++ b/drivers/platform/x86/lenovo/think-lmi.c @@ -20,7 +20,7 @@ #include #include #include -#include "../firmware_attributes_class.h" +#include #include "think-lmi.h" static bool debug_support; diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86/lenovo/wmi-other.c index fbb32bf404f2..e9a2c4684e5f 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -50,7 +50,7 @@ #include "wmi-capdata.h" #include "wmi-events.h" #include "wmi-helpers.h" -#include "../firmware_attributes_class.h" +#include #define LENOVO_OTHER_MODE_GUID "DC2A8805-3A8C-41BA-A6F7-092E0089CD3B" diff --git a/drivers/platform/x86/samsung-galaxybook.c b/drivers/platform/x86/samsung-galaxybook.c index 6382af0b106c..74b8c887dd79 100644 --- a/drivers/platform/x86/samsung-galaxybook.c +++ b/drivers/platform/x86/samsung-galaxybook.c @@ -28,7 +28,7 @@ #include #include #include -#include "firmware_attributes_class.h" +#include #define DRIVER_NAME "samsung-galaxybook" diff --git a/drivers/platform/x86/firmware_attributes_class.h b/include/linux/firmware_attributes.h similarity index 60% rename from drivers/platform/x86/firmware_attributes_class.h rename to include/linux/firmware_attributes.h index d27abe54fcf9..d4026ba1fcc2 100644 --- a/drivers/platform/x86/firmware_attributes_class.h +++ b/include/linux/firmware_attributes.h @@ -2,11 +2,11 @@ /* Firmware attributes class helper module */ -#ifndef FW_ATTR_CLASS_H -#define FW_ATTR_CLASS_H +#ifndef _LINUX_FIRMWARE_ATTRIBUTES_H +#define _LINUX_FIRMWARE_ATTRIBUTES_H #include extern const struct class firmware_attributes_class; -#endif /* FW_ATTR_CLASS_H */ +#endif /* _LINUX_FIRMWARE_ATTRIBUTES_H */ -- 2.53.0