[PATCH v2 3/3] platform/x86: wmi-bmof: Move to generic WMI code

Armin Wolf <[email protected]> Fri, 24 Jul 2026 04:25:26 +0200
Newsgroups org.freedesktop.lists.intel-gfx,org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel,org.freedesktop.lists.intel-xe,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86
Message-ID <[email protected]>
Some Windows-on-Arm notebooks contain embedded Binary MOF data,
accessible using the WMI-ACPI interface. Move the associated driver
to the generic WMI code to make it possible to build it on arm64.
Also rework the Kconfig help text a bit.

Link: https://lists.linaro.org/archives/list/[email protected]/thread/U2IZENSIOOHZHGXVN7GM5HX5O3FD5KCF/
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Armin Wolf <[email protected]>
---
 MAINTAINERS                                     |  2 +-
 drivers/platform/wmi/Kconfig                    | 12 ++++++++++++
 drivers/platform/wmi/Makefile                   |  4 ++++
 drivers/platform/{x86/wmi-bmof.c => wmi/bmof.c} |  0
 drivers/platform/x86/Kconfig                    | 12 ------------
 drivers/platform/x86/Makefile                   |  3 ---
 6 files changed, 17 insertions(+), 16 deletions(-)
 rename drivers/platform/{x86/wmi-bmof.c => wmi/bmof.c} (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3820b286f09f..bbae729a6012 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29106,7 +29106,7 @@ L:	[email protected]
 S:	Maintained
 F:	Documentation/ABI/stable/sysfs-platform-wmi-bmof
 F:	Documentation/wmi/devices/wmi-bmof.rst
-F:	drivers/platform/x86/wmi-bmof.c
+F:	drivers/platform/wmi/bmof.c
 
 WOLFSON MICROELECTRONICS DRIVERS
 L:	[email protected]
diff --git a/drivers/platform/wmi/Kconfig b/drivers/platform/wmi/Kconfig
index 36934b5f0194..11c221a58e04 100644
--- a/drivers/platform/wmi/Kconfig
+++ b/drivers/platform/wmi/Kconfig
@@ -34,4 +34,16 @@ config ACPI_WMI_LEGACY_DEVICE_NAMES
 
 source "drivers/platform/wmi/tests/Kconfig"
 
+config WMI_BMOF
+	tristate "WMI embedded Binary MOF driver"
+	default ACPI_WMI
+	help
+	  Say Y here if you want to be able to read the firmware-embedded
+	  WMI Binary MOF (Managed Object Format) data. Using this requires
+	  userspace tools, see Documentation/wmi/devices/wmi-bmof.rst for
+	  details.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called wmi-bmof.
+
 endif # ACPI_WMI
diff --git a/drivers/platform/wmi/Makefile b/drivers/platform/wmi/Makefile
index 2feff94a5594..ee2f27ea20d1 100644
--- a/drivers/platform/wmi/Makefile
+++ b/drivers/platform/wmi/Makefile
@@ -9,3 +9,7 @@ obj-$(CONFIG_ACPI_WMI)	+= wmi.o
 
 # Unit tests
 obj-y			+= tests/
+
+# Binary MOF driver
+wmi-bmof-y		:= bmof.o
+obj-$(CONFIG_WMI_BMOF)	+= wmi-bmof.o
diff --git a/drivers/platform/x86/wmi-bmof.c b/drivers/platform/wmi/bmof.c
similarity index 100%
rename from drivers/platform/x86/wmi-bmof.c
rename to drivers/platform/wmi/bmof.c
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 957034f39e4e..889979034391 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -16,18 +16,6 @@ menuconfig X86_PLATFORM_DEVICES
 
 if X86_PLATFORM_DEVICES
 
-config WMI_BMOF
-	tristate "WMI embedded Binary MOF driver"
-	depends on ACPI_WMI
-	default ACPI_WMI
-	help
-	  Say Y here if you want to be able to read a firmware-embedded
-	  WMI Binary MOF (Managed Object Format) data. Using this requires
-	  userspace tools and may be rather tedious.
-
-	  To compile this driver as a module, choose M here: the module will
-	  be called wmi-bmof.
-
 config HUAWEI_WMI
 	tristate "Huawei WMI laptop extras driver"
 	depends on ACPI_BATTERY
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 872ac3842391..94a5fe4075cb 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -4,9 +4,6 @@
 # x86 Platform-Specific Drivers
 #
 
-# Windows Management Interface
-obj-$(CONFIG_WMI_BMOF)		+= wmi-bmof.o
-
 # WMI drivers
 obj-$(CONFIG_HUAWEI_WMI)		+= huawei-wmi.o
 obj-$(CONFIG_MXM_WMI)			+= mxm-wmi.o
-- 
2.39.5