From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 E44FD3D9020 for ; Mon, 27 Jul 2026 19:51:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785181889; cv=none; b=siduVZyq9Iznw49Xu4lxcR+2JWdu/oTkrCsC77efeQQ3Q+2qLco7lF5ymtXQMFIWdiXeUCQspZZgQpm0rFzY/B0uZOkO58I+dIWfYkTRUxfeW0xErZ92t29mwXcdma20aVh58u+gL0Bti5MS+DnLeOzRcOKD8SBAyfsUO3dp9eU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785181889; c=relaxed/simple; bh=u9ae5vVAutRv+siORHRZYoK0VxPcGZBF66otpkE88FE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GrfOY/Haezo9orTSbiwotHXdoH/bgmCx4QeYusrx9zVvCQymY5bPAjxAq9yxC8/UB6KQRzHj7a1jYE6RtQ9dlXF3eJYDfRyWa6Qx5fChDGMz/IMZTPB20tK6x4AZ/FeuK/bvFwiaS6GwUFcBTxNoI+2/Gs7UudYRDnJv/n2ila4= 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=u824CtBm; arc=none smtp.client-ip=209.85.221.53 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="u824CtBm" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-47f92e3c14bso2823487f8f.0 for ; Mon, 27 Jul 2026 12:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20251104.gappssmtp.com; s=20251104; t=1785181884; x=1785786684; 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=isgybkJnkqx1Zylhck0Bwa7zAkGZmozqkpWxErffC5U=; b=u824CtBmlQDpAfG8E+pfsldqGMdVfZ/l2ThQAWdYp2iqyaDhmtO+Tv+f7pFFgxvke7 x6AlRH246aWuhE7rLhy5dy4mhznGNU3vlv9F0UKrpuP2k6MOWJU3PXRqxe59xZIHYHL8 cYTPi1RUGSS78coYRkz+wUktqoGM1GSRChYtkX1/lRGqoFclCRZWUEfWLuNfGA2424cd tfbtcpJHmk0EnbJWJ9VPUGmWpiVibUr9WwKV2yip5RZ4JrcLceUMUv1UpfYVdE6zZqUx d/+1jhb9TXGAXPXKb14wBcQ1PK/ZfvPfamxm+xbmDBmKLjqkGJvkJcTRiBF6DFaWd3YK S9PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785181884; x=1785786684; 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=isgybkJnkqx1Zylhck0Bwa7zAkGZmozqkpWxErffC5U=; b=eURc8CGAq+/mj9HbIRQNovTLYDckID0QIaZxlhFfckHBsEEZ+TZpf0Av2xFGzTu3c6 zPz6FhHUfwM+bogDDQ3sdYJniRlAAte6UXEHb7gZmHhfLYn4fWk/8wY7LgqCCm/PXMvU gFAoVWbPpvl2GyUCLKJ6X+FgD6XosN/DDLLLW7SNXzhw2Jyp+Ujp73T9wJ5JfoZ/ULJv 5faWfZ7Q6Y4w53NewiKJTlbntGGTkq9UxDjP12ItNMibQ8lv27Vy61+QLbvBADO2RsMd MHXc5c7pnfIThwBv0b9uu607UM9fmadoWLV707z7ejg3Lktyh3XVgKznnOtyJ2DxtlFw GJdw== X-Forwarded-Encrypted: i=1; AHgh+RppnQ/2NpwGpXLLUhJ8DW4dV6E4l8a3hdz/HTrPqqyqo7PASxGeDGrBeTyWodlRU5lTSPehdzEy1THJE8s=@vger.kernel.org X-Gm-Message-State: AOJu0YxWtThr8deLLMYk36vt/wiktS/3pXhEQA5AiywWI6ogKdJulks6 UuXCnA0RcR6pRRCpaMO0oorDlOwvoiA4NY1r660LkR8yITSKtinXMb83IM3GEvtXMg== X-Gm-Gg: AR+sD10tfzA4VaionHiLNa5yzqGFdjhUvveKpfjIXVlqSJWz+mN+CRkJ/cz4CkUzURQ KOmBNK5guDBSLCYHYgrlcoRMyczYljb3Rmjrc7Qx1Bf4N8ew7DIbMKSj/E+1zzwIYGG+Bs/Pyny WC5rvrxYuCLUc3vzhkb5BtKq/DV7K3xmVklpnmfhQJlobCLO9JEtW2goazxCWA233qm+uLGWIz5 DK1lbj6adJSJiHRXcocx2J+bqNOAmJ2Bqblp9RtovgmXSWG1FM32GHhZvgKMmlJhilte71OtSsI deIu0lfeUOcpHyjA+RwWoAJuCR6nnyjhfDeld7bhEJd7rVuO6bk5cdMy2d2x7SIJ5NZ3BJPKNwy enwnEAoIuQygTD6zY98YbUcFgN9HGmpdefe7SiFkDqeeZJsivkgKD717Of9jwvjVkcqYpuRyQBn ODko3EuvLbzOz2NSXcNKq2Yq3Ma03YOfWTH/9bZH4= X-Received: by 2002:a05:600c:6214:b0:495:745e:7430 with SMTP id 5b1f17b1804b1-496b56f1313mr126285135e9.20.1785181883904; Mon, 27 Jul 2026 12:51:23 -0700 (PDT) Received: from horizon ([217.155.46.38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4957bd9e980sm253362445e9.0.2026.07.27.12.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 12:51:23 -0700 (PDT) From: Sean Rhodes To: tzungbi@kernel.org Cc: Corentin Chary , "Luke D. Jones" , Denis Benato , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Prasanth Ksr , Jorge Lopez , Mark Pearson , "Derek J. Clark" , Joshua Grisham , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Dell.Client.Kernel@dell.com, Sean Rhodes , "Michael S. Tsirkin" , Florian Fainelli , Huacai Chen , Chen-Yu Tsai , Brian Norris , Julius Werner , Thomas Zimmermann , Javier Martinez Canillas , Takashi Sakamoto , Bjorn Helgaas , Danilo Krummrich , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= , Titouan Ameline de Cadeville , Kees Cook , chrome-platform@lists.linux.dev Subject: [PATCH v9 2/4] firmware: Move firmware attributes class helper Date: Mon, 27 Jul 2026 20:51:12 +0100 Message-ID: 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 firmware lets coreboot firmware drivers use the standard firmware-attributes ABI without living under platform/x86. 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 1ab8736850ea..3b21dc411b43 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10115,6 +10115,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 f3d8c5a85762..e6af93608ec5 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -20,7 +20,7 @@ #include #include #include -#include "firmware_attributes_class.h" +#include #include #include #include diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index 4ff9003c6589..963b3473991d 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -9,7 +9,7 @@ #include #include -#include "../../firmware_attributes_class.h" +#include #include #include #include diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index 1965a329be48..f13f21580acd 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -8,7 +8,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include -#include "../../firmware_attributes_class.h" +#include #include #include #include diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c index 9e4b3e973de9..4437785aa1f2 100644 --- a/drivers/platform/x86/lenovo/think-lmi.c +++ b/drivers/platform/x86/lenovo/think-lmi.c @@ -15,7 +15,7 @@ #include #include #include -#include "../firmware_attributes_class.h" +#include #include #include #include diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86/lenovo/wmi-other.c index fdebaa0a9992..b175971bb308 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -33,7 +33,7 @@ #include #include #include -#include "../firmware_attributes_class.h" +#include #include #include #include diff --git a/drivers/platform/x86/samsung-galaxybook.c b/drivers/platform/x86/samsung-galaxybook.c index 74103c00b0c8..3911f60c23ea 100644 --- a/drivers/platform/x86/samsung-galaxybook.c +++ b/drivers/platform/x86/samsung-galaxybook.c @@ -14,7 +14,7 @@ #include #include #include -#include "firmware_attributes_class.h" +#include #include #include #include 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 */