From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 5ECFD3793AC for ; Tue, 1 Sep 2026 17:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788284895; cv=none; b=GPiXw3tIridwH6XnAAg47DE6a0LlNXOy8RU+IT86hJWrDVojfSqyW2ZI2b8Ps87EB3j/ia9+7HuhSBiFMBCe3AC46/aR7It+u1qhasXNsJ5GUYmBkvffsaVXxlW8Z6VOkOsyx0iHr9UfpcJ3qDqPOTyOcvDCA2bi5ELMR+/Ap0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788284895; c=relaxed/simple; bh=vlg77wolsoVFMBQPq6m20qH3uHGfUAOllu68Fyi4ZQU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pT8mpCm6gRlN2gcWY9lzayte6PbewngWJF3RIfVSUFzNBHqkC/Tk3ztoOCdcYQRB6oKoxs2GIvn/6gBpCeIjS47ef95MlZXJvSK4jgPZV9PRLkc0Vv6twwUHN/PYx2QgEaUOTU1pijyKzTPccXsVuc5tk3shmwNbkA1C8QXSxAo= 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=KtZlXdjL; arc=none smtp.client-ip=209.85.128.49 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="KtZlXdjL" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-49b0dbfbf7bso366565e9.2 for ; Tue, 01 Sep 2026 10:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20251104.gappssmtp.com; s=20251104; t=1788284890; x=1788889690; 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=tXCHJIwjGHRpvPAJmWpnTHd3j6ug3youjBf+VTwSpcg=; b=KtZlXdjLovzHLVDpdrs5gHUoROvQH337qIyXHQC4ZbakMWW3qEitWw5xvLorU0j2hG DoQ1Vv3AdxB2CVTbw2khCIO0k/k1EgdNeaCBeR+KHeV9QrEklupHjeSQxh6VYKSG54OB 3ChIqQ+Ybnw2ceyOKqekrqt9iez596uNjjommNycKQisyfdVbnXt5kJdZqsEdZYNwdX0 wNM4LLd6PHoArGWk2O9XHIfmXnRPu8wFJ4gw6OCwuP26R1zCJt1sDvK0Lk3vrIbR8yJK GP4vQoxkzR9r5qVByryh5yEbLmkMdOMR8n3HhJZwk9iqMexzsjgmqimAC5FI2tPjq4Oo qSiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788284890; x=1788889690; 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=tXCHJIwjGHRpvPAJmWpnTHd3j6ug3youjBf+VTwSpcg=; b=IfhEqJ5aOCnuwocQeJXTVJL/TTy85Hci3Mz6TcAauTA48Bwjl4+Y5rNfzglpicoPA6 JbB+xZKMGdBikEkjXkIr3ILXKgqeo20rIJ7PN9BzKpbNvWagAsTOj6yl12jwtPnq2ZrL +UOlrkbyf7o1moXQEFn311tvmKCPcSXN729mYCCebRq1QbEn//s/PUsCwbV7YEN0A6y6 TtHA/4Jad86Tcx6XDerK+EcCHHBfOmcC7VWKfxLXunTobxjEiz/mIyLdGVXNJnQor+H0 38eSJpPVFmyHCDY/ffLsDGAejxpTic2rUY5rcvJO3XON1niXrFpe7JvV/F5/jiE5m1Wv J0nA== X-Gm-Message-State: AFuF++miHXAdzGpZelS9FNQS+2m5PGYdweJ/F92YYVRSqPp7DzrD5bTP pFxb13jatevoHJxjS25u4V9wfpvQAOjSdPIcQFDJgTDIVji7aRDWndBOzHX/Bt1pZ3Nf+C3PUq3 bJlW2bk6o X-Gm-Gg: AR+sD11yund4dllxpm1ovte3yxdIoICvBOnSfyNeamEn9w5Ru54PTknWV1YZ4NMmfb7 IAvAWdGAksjzJYoZY6Rfa/vXZO4fKfs+1P25zSsUpvEU9dtfnRYE7bkkejBsb/OvvA80GEJ7svp 5RU4FUtYTfVOu6pCNpuzoGEXGHvechrcIn9rOl67GOE5QuCp0/UMaAsv+78HeGr+iJ1AR9IBxST 7kmAdsU9HiJrDhmgi5x+CkTlbuWGUN4G1OZfkMVeaxsEmyHuy8ttTD6pt4IReosrHonwcfuGM0H /VpkeR4OXnvqojPopYPsQX45nGwK3uFX6qmYEZVhK6c2giNnUHxh5YZZg7QDTsHn8EkM09QH1xM F9d27k2J1+xmfqxoXcqwC2woP4Mfv7i1aFk9oHXsibQ2DmaN8il86Q5mmMPVWp6Bt+wDw+TQGch 7iZRWLPuctmzZRO+DpSkdeW4iHNQzc49f4EQ/6BxHya2JSPE7Uk2kr/rw0AoUOsnBw3nOxAOWHc CPoULLwnAGlehk8 X-Received: by 2002:a05:600c:83c7:b0:499:8174:9f39 with SMTP id 5b1f17b1804b1-49cdc3cf96amr196466835e9.0.1788284890166; Tue, 01 Sep 2026 10:48:10 -0700 (PDT) Received: from horizon ([217.155.46.38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49ce47885b1sm2369225e9.14.2026.09.01.10.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 10:48:09 -0700 (PDT) From: Sean Rhodes To: linux-kernel@vger.kernel.org Cc: Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Corentin Chary , "Luke D. Jones" , Denis Benato , Prasanth Ksr , Jorge Lopez , Mark Pearson , "Derek J. Clark" , Joshua Grisham , Will Deacon , Douglas Anderson , "Kiryl Shutsemau (Meta)" , Sean Rhodes , Huacai Chen , Chen-Yu Tsai , Thomas Zimmermann , platform-driver-x86@vger.kernel.org, Dell.Client.Kernel@dell.com, Tzung-Bi Shih , Brian Norris , Julius Werner , Javier Martinez Canillas , Bjorn Helgaas , Danilo Krummrich , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= , Titouan Ameline de Cadeville , Laxman Acharya Padhya , Yidi Lin , Kees Cook , Takashi Sakamoto , chrome-platform@lists.linux.dev, Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, Krzysztof Kozlowski , Bjorn Andersson , Dmitry Baryshkov , Geert Uytterhoeven , Arnd Bergmann , Eric Biggers , Luca Weiss , Michal Simek , Sven Peter , Alexandre Belloni , Linus Walleij , Drew Fustini , linux-arm-kernel@lists.infradead.org, soc@lists.linux.dev Subject: [PATCH v14 1/5] firmware: Move firmware attributes class helper Date: Tue, 1 Sep 2026 18:48:02 +0100 Message-ID: <5682c2228fa4a784d3953664b56a06e0dd9ccdef.1788284852.git.sean@starlabs.systems> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: 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 drivers/firmware lets coreboot firmware drivers use the standard firmware-attributes ABI without living under platform/x86. Replace the affected drivers' relative helper includes directly with the new public header. Suggested-by: Derek J. Clark Reviewed-by: Mark Pearson Reviewed-by: Derek J. Clark Tested-by: Oliver Lin 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 4dfc1fb14ef7..a8048eaf49e5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10181,6 +10181,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 b7cc11e4fbfa..35dd6d422caf 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 be46f1e1dc77..0e1e1b92a486 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -17,6 +17,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 957034f39e4e..4851bf45157d 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -925,9 +925,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 93d9665717af..fb382de5b57b 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include "asus-armoury.h" -#include "firmware_attributes_class.h" #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..ae89670f73b4 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -10,13 +10,13 @@ #include #include #include +#include #include #include #include #include #include #include "dell-wmi-sysman.h" -#include "../../firmware_attributes_class.h" #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 309634c1cc20..d5a2d0963bbf 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -7,6 +7,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include "bioscfg.h" -#include "../../firmware_attributes_class.h" #include #include diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c index a0e3fa766e37..ebfc6182986e 100644 --- a/drivers/platform/x86/lenovo/think-lmi.c +++ b/drivers/platform/x86/lenovo/think-lmi.c @@ -14,13 +14,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include "../firmware_attributes_class.h" #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..b175971bb308 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #include "wmi-capdata.h" #include "wmi-events.h" #include "wmi-helpers.h" -#include "../firmware_attributes_class.h" #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 99f72b204a51..88ef11004ad0 100644 --- a/drivers/platform/x86/samsung-galaxybook.c +++ b/drivers/platform/x86/samsung-galaxybook.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include "firmware_attributes_class.h" #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 */