firmware: Move firmware attributes class helper

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 <derekjohn.clark@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com>
Tested-by: Oliver Lin <oliver@liuxiaozhen.dev>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/5682c2228fa4a784d3953664b56a06e0dd9ccdef.1788284852.git.sean@starlabs.systems
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
This commit is contained in:
Sean Rhodes 2026-09-01 18:48:02 +01:00 committed by Tzung-Bi Shih
parent 0e30b98a54
commit 6f3adf358c
13 changed files with 22 additions and 15 deletions

View File

@ -10194,6 +10194,14 @@ F: include/linux/firewire.h
F: include/uapi/linux/firewire*.h
F: tools/firewire/
FIRMWARE ATTRIBUTES CLASS
M: Hans de Goede <hansg@kernel.org>
M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
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 <sudeep.holla@kernel.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)

View File

@ -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

View File

@ -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

View File

@ -3,7 +3,7 @@
/* Firmware attributes class helper module */
#include <linux/module.h>
#include "firmware_attributes_class.h"
#include <linux/firmware_attributes.h>
const struct class firmware_attributes_class = {
.name = "firmware-attributes",

View File

@ -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

View File

@ -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

View File

@ -21,6 +21,7 @@
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/firmware_attributes.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
@ -35,7 +36,6 @@
#include <linux/sysfs.h>
#include "asus-armoury.h"
#include "firmware_attributes_class.h"
#define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"

View File

@ -10,13 +10,13 @@
#include <linux/align.h>
#include <linux/fs.h>
#include <linux/dmi.h>
#include <linux/firmware_attributes.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/wmi.h>
#include "dell-wmi-sysman.h"
#include "../../firmware_attributes_class.h"
#define MAX_TYPES 4
#include <linux/nls.h>

View File

@ -7,6 +7,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/firmware_attributes.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/kernel.h>
@ -14,7 +15,6 @@
#include <linux/string.h>
#include <linux/wmi.h>
#include "bioscfg.h"
#include "../../firmware_attributes_class.h"
#include <linux/nls.h>
#include <linux/errno.h>

View File

@ -14,13 +14,13 @@
#include <linux/acpi.h>
#include <linux/array_size.h>
#include <linux/errno.h>
#include <linux/firmware_attributes.h>
#include <linux/fs.h>
#include <linux/mutex.h>
#include <linux/string_helpers.h>
#include <linux/types.h>
#include <linux/dmi.h>
#include <linux/wmi.h>
#include "../firmware_attributes_class.h"
#include "think-lmi.h"
static bool debug_support;

View File

@ -33,6 +33,7 @@
#include <linux/container_of.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/firmware_attributes.h>
#include <linux/gfp_types.h>
#include <linux/hwmon.h>
#include <linux/idr.h>
@ -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"

View File

@ -14,6 +14,7 @@
#include <linux/acpi.h>
#include <linux/bits.h>
#include <linux/err.h>
#include <linux/firmware_attributes.h>
#include <linux/i8042.h>
#include <linux/init.h>
#include <linux/input.h>
@ -28,7 +29,6 @@
#include <linux/uuid.h>
#include <linux/workqueue.h>
#include <acpi/battery.h>
#include "firmware_attributes_class.h"
#define DRIVER_NAME "samsung-galaxybook"

View File

@ -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 <linux/device/class.h>
extern const struct class firmware_attributes_class;
#endif /* FW_ATTR_CLASS_H */
#endif /* _LINUX_FIRMWARE_ATTRIBUTES_H */