Re: [PATCH v14 1/5] firmware: Move firmware attributes class helper

2026-09-29 Thread Ilpo Järvinen
On Tue, 1 Sep 2026, Sean Rhodes wrote:

> 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:   [email protected]
> +S:   Maintained
> +F:   drivers/firmware/firmware_attributes_class.c
> +F:   include/linux/firmware_attributes.h
> +
>  FIRMWARE FRAMEWORK FOR ARMV8-A
>  M:   Sudeep Holla 
>  L:   [email protected] (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)  += 

[PATCH v14 1/5] firmware: Move firmware attributes class helper

2026-09-03 Thread Sean Rhodes
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: [email protected]
+S: Maintained
+F: drivers/firmware/firmware_attributes_class.c
+F: include/linux/firmware_attributes.h
+
 FIRMWARE FRAMEWORK FOR ARMV8-A
 M: Sudeep Holla 
 L: [email protected] (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 

Re: [PATCH v14 1/5] firmware: Move firmware attributes class helper

2026-09-02 Thread Tzung-Bi Shih
On Tue, Sep 01, 2026 at 06:48:02PM +0100, Sean Rhodes wrote:
> 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 

LGTM,
Reviewed-by: Tzung-Bi Shih