Re: [PATCH 1/2] platform/x86: dell: Add new dell-wmi-pega driver

From: Ilpo Järvinen

Date: Tue Nov 17 2026 - 17:17:34 EST


On Tue, 17 Nov 2026, Armin Wolf wrote:

> A user has reported that the WMI hotkey events on Dell All-In-One
> machines need to be manually enabled on some models thru a separate
> WMI device. This WMI device seems to be present on many other models
> but has no effect on them.

Can you rephrase this to not textually depend on "user" or "user's
report", just state what the problem is, not how you became aware of it.

> Add a small driver for enabling support for this WMI device. This
> enables the HDMI Input key on the Dell OptiPlex 7400 All-in-One
> machine.
>
> Reported-by: Teodora <teolyub@xxxxxxxxx>
> Closes: https://lore.kernel.org/platform-driver-x86/0TZENT.54P2IBFQRED22@xxxxxxxxx
> Tested-by: Teodora <teolyub@xxxxxxxxx>
> Signed-off-by: Armin Wolf <W_Armin@xxxxxx>
> ---
> Documentation/wmi/devices/dell-wmi-pega.rst | 82 ++++++++++++++++++
> MAINTAINERS | 6 ++
> drivers/platform/x86/dell/Kconfig | 13 +++
> drivers/platform/x86/dell/Makefile | 1 +
> drivers/platform/x86/dell/dell-wmi-pega.c | 93 +++++++++++++++++++++
> 5 files changed, 195 insertions(+)
> create mode 100644 Documentation/wmi/devices/dell-wmi-pega.rst
> create mode 100644 drivers/platform/x86/dell/dell-wmi-pega.c
>
> diff --git a/Documentation/wmi/devices/dell-wmi-pega.rst b/Documentation/wmi/devices/dell-wmi-pega.rst
> new file mode 100644
> index 000000000000..935c8511594b
> --- /dev/null
> +++ b/Documentation/wmi/devices/dell-wmi-pega.rst
> @@ -0,0 +1,82 @@
> +.. SPDX-License-Identifier: GPL-2.0-or-later
> +
> +===========================================================
> +Dell All-In-One Series Platform Integration (dell-wmi-pega)
> +===========================================================
> +
> +Introduction
> +------------
> +
> +Many Dell All-In-One devices contain a WMI device for notifying the underlying platform
> +of various OS-specific events like power up, shutdown and backlight brightness control.
> +
> +Not implementing support for this WMI device might prevent hotkeys exposed over WMI from
> +working on some models.
> +
> +WMI interface description
> +=========================
> +
> +The WMI interface description can be decoded from the embedded binary MOF (bmof)
> +data using the `bmfdec <https://github.com/pali/bmfdec>`_ utility:
> +
> +::
> +
> + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"),
> + Description("Class used to operate method - WMBC"),
> + guid("{2D703EE8-36AC-4F88-BDB5-7556CE6B2946}") : ToInstance]
> + class AcpiOSD_WMBC_method : WMIMethod {
> +
> + [key, read]
> + string InstanceName;
> +
> + [read]
> + boolean Active;
> +
> + [WmiMethodId(1), Implemented, read, write,
> + Description("Invoked by AP when system up.")]
> + void PegaOemNotificationStartUp([out, Description("Return Value")] uint32 RetVal);
> +
> + [WmiMethodId(2), Implemented, read, write,
> + Description("Invoked by AP when system is going to off state.")]
> + void PegaOemNotificationStop([out, Description("Return Value")] uint32 RetVal);
> +
> + [WmiMethodId(3), Implemented, read, write,
> + Description("Invoked by Application to tune up brightness.")]
> + void PegaOemNotificationBrightnessUP([out, Description("Return Value")] uint32 RetVal);
> +
> + [WmiMethodId(4), Implemented, read, write,
> + Description("Invoked by Application to tune down brightness.")]
> + void PegaOemNotificationBrightnessDown([out, Description("Return Value")] uint32 RetVal);
> +
> + [WmiMethodId(5), Implemented, read, write, Description("Reserved.")]
> + void PegaOemNotificationRSVD1([out, Description("Return Value")] uint32 RetVal);
> +
> + [WmiMethodId(6), Implemented, read, write, Description("Reserved.")]
> + void PegaOemNotificationRSVD2([out, Description("Return Value")] uint32 RetVal);
> + };
> +
> +The return value of each WMI method should be equal to the WMI method ID.
> +
> +WMI method PegaOemNotificationStartUp()
> +---------------------------------------
> +
> +Notifies the platform that the OS is operational. On some models this WMI method also enables
> +reporting of hotkey events over WMI.
> +
> +WMI method PegaOemNotificationStop()
> +------------------------------------
> +
> +Notifies the platform that the OS is shutting down.
> +
> +WMI method PegaOemNotificationBrightnessUP()
> +--------------------------------------------
> +
> +Notifies the platform that the user wants to increase the backlight brightness. This WMI method
> +usually only forwards this request to the acpi-video driver, so the dell-wmi-pega driver does
> +not use it.

Could these paragraphs be reflowed to 80 chars as long textual lines are
harder to read (eye movement required).

> +WMI method PegaOemNotificationBrightnessDown()
> +----------------------------------------------
> +
> +Notifies the platform that the user wants to decrease the backlight brightness. See
> +``PegaOemNotificationBrightnessUP()`` for details.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index bd31e734669e..fb9a80f96900 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7534,6 +7534,12 @@ M: Pali Rohár <pali@xxxxxxxxxx>
> S: Maintained
> F: drivers/platform/x86/dell/dell-wmi-base.c
>
> +DELL WMI PEGA DRIVER
> +M: Armin Wolf <W_Armin@xxxxxx>
> +S: Odd Fixes
> +F: Documentation/wmi/devices/dell-wmi-pega.rst
> +F: drivers/platform/x86/dell/dell-wmi-pega.c
> +
> DELL WMI SYSMAN DRIVER
> M: Prasanth Ksr <prasanth.ksr@xxxxxxxx>
> L: Dell.Client.Kernel@xxxxxxxx
> diff --git a/drivers/platform/x86/dell/Kconfig b/drivers/platform/x86/dell/Kconfig
> index 9f0016056d7e..289379383ccb 100644
> --- a/drivers/platform/x86/dell/Kconfig
> +++ b/drivers/platform/x86/dell/Kconfig
> @@ -228,6 +228,7 @@ config DELL_WMI_AIO
> depends on ACPI_WMI
> depends on INPUT
> select INPUT_SPARSEKMAP
> + imply DELL_WMI_PEGA
> help
> Say Y here if you want to support WMI-based hotkeys on Dell
> All-In-One machines.
> @@ -262,6 +263,18 @@ config DELL_WMI_LED
> This adds support for the Latitude 2100 and similar
> notebooks that have an external LED.
>
> +config DELL_WMI_PEGA
> + tristate "Dell WMI AIO Platform Support"
> + default m
> + depends on ACPI_WMI
> + help
> + This option adds support for WMI-based platform integration on Dell All-In-One machines.
> + This driver is necessary for enabling the delivery of hotkey events to the dell-wmi-aio
> + driver on some machines.
> +
> + To compile this drivers as a module, choose M here: the module will be called
> + dell-wmi-pega.
> +
> config DELL_WMI_SYSMAN
> tristate "Dell WMI-based Systems management driver"
> default m
> diff --git a/drivers/platform/x86/dell/Makefile b/drivers/platform/x86/dell/Makefile
> index 470874c6e6e6..46c91c240a2c 100644
> --- a/drivers/platform/x86/dell/Makefile
> +++ b/drivers/platform/x86/dell/Makefile
> @@ -27,5 +27,6 @@ obj-$(CONFIG_DELL_WMI_AIO) += dell-wmi-aio.o
> obj-$(CONFIG_DELL_WMI_DESCRIPTOR) += dell-wmi-descriptor.o
> obj-$(CONFIG_DELL_WMI_DDV) += dell-wmi-ddv.o
> obj-$(CONFIG_DELL_WMI_LED) += dell-wmi-led.o
> +obj-$(CONFIG_DELL_WMI_PEGA) += dell-wmi-pega.o
> obj-$(CONFIG_DELL_WMI_SYSMAN) += dell-wmi-sysman/
> obj-$(CONFIG_DELL_DW5826E_RESET) += dell-dw5826e-reset.o
> diff --git a/drivers/platform/x86/dell/dell-wmi-pega.c b/drivers/platform/x86/dell/dell-wmi-pega.c
> new file mode 100644
> index 000000000000..ddb1b6cc6b1c
> --- /dev/null
> +++ b/drivers/platform/x86/dell/dell-wmi-pega.c
> @@ -0,0 +1,93 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * WMI platform integration for Dell All-In-One series.
> + *
> + * Copyright (C) 2026 Armin Wolf <W_Armin@xxxxxx>
> + *
> + * Based on earlier work by Teodora <teolyub@xxxxxxxxx>.
> + */
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> +#include <linux/cleanup.h>
> +#include <linux/device.h>
> +#include <linux/device/driver.h>
> +#include <linux/dev_printk.h>
> +#include <linux/kernel.h>

What for is this?

I suspect direct device.h include isn't necessary either (and it's
anyway guaranteed to come through wmi.h).

> +#include <linux/module.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>
> +#include <linux/wmi.h>
> +
> +#define PEGA_GUID "2D703EE8-36AC-4F88-BDB5-7556CE6B2946"
> +
> +enum dell_pega_method {
> + DELL_PEGA_NOTIFICATION_STARTUP = 0x01,
> + DELL_PEGA_NOTIFICATION_STOP = 0x02,
> + DELL_PEGA_NOTIFICATION_BRIGHTNESS_UP = 0x03,
> + DELL_PEGA_NOTIFICATION_BRIGHTNESS_DOWN = 0x04,
> + DELL_PEGA_NOTIFICATION_RESERVED_1 = 0x05,
> + DELL_PEGA_NOTIFICATION_RESERVED_2 = 0x06,
> +};
> +
> +static int dell_wmi_pega_invoke(struct wmi_device *wdev, enum dell_pega_method method)
> +{
> + struct wmi_buffer input = { };
> + struct wmi_buffer output;
> + int ret;
> +
> + ret = wmidev_invoke_method(wdev, 0x0, method, &input, &output, sizeof(__le32));
> + if (ret < 0)
> + return ret;
> +
> + __le32 *result __free(kfree) = output.data;
> + /* The return value should always be equal to the WMI method ID */
> + if (le32_to_cpu(*result) != method)

Include for le32_to_cpu()

> + return -EIO;
> +
> + return 0;
> +}
> +
> +static int dell_wmi_pega_probe(struct wmi_device *wdev, const void *context)
> +{
> + int ret;
> +
> + ret = dell_wmi_pega_invoke(wdev, DELL_PEGA_NOTIFICATION_STARTUP);
> + if (ret < 0)
> + dev_err(&wdev->dev,
> + "Failed to notify platform of startup, some hotkeys might not work\n");

braces for multiline constructs.

> +
> + return ret;
> +}
> +
> +static void dell_wmi_pega_shutdown(struct wmi_device *wdev)
> +{
> + int ret;
> +
> + ret = dell_wmi_pega_invoke(wdev, DELL_PEGA_NOTIFICATION_STOP);
> + if (ret < 0)
> + dev_warn(&wdev->dev, "Failed to notify platform of shutdown\n");
> +}
> +
> +static const struct wmi_device_id dell_wmi_pega_id_table[] = {
> + { PEGA_GUID, NULL },
> + { }
> +};
> +MODULE_DEVICE_TABLE(wmi, dell_wmi_pega_id_table);
> +
> +static struct wmi_driver dell_wmi_pega_driver = {
> + .driver = {
> + .name = "dell-wmi-pega",
> + .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> + },
> + .id_table = dell_wmi_pega_id_table,
> + .probe = dell_wmi_pega_probe,
> + .remove = dell_wmi_pega_shutdown,
> + .shutdown = dell_wmi_pega_shutdown,
> + .no_singleton = true,
> +};
> +module_wmi_driver(dell_wmi_pega_driver);
> +
> +MODULE_AUTHOR("Armin Wolf <W_Armin@xxxxxx>");
> +MODULE_DESCRIPTION("Dell All-In-One series platform integration");
> +MODULE_LICENSE("GPL");

Just the mandatory nitpicking :-), seems fine otherwise.


--
i.