platform/x86: dell: Add new dell-wmi-pega driver
Subsystems (3)
Armin Wolf
maintainerPATCH 1/2 platform/x86: dell: Add new dell-wmi-pega driver
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.
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.
--- 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
Documentation/wmi/devices/dell-wmi-pega.rst new file +82 -0
@@ -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. + +WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlight brightness. See +``PegaOemNotificationBrightnessUP()`` for details.
MAINTAINERS +6 -0
@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]
drivers/platform/x86/dell/Kconfig +13 -0
@@ -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
drivers/platform/x86/dell/Makefile +1 -0
@@ -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
drivers/platform/x86/dell/dell-wmi-pega.c new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
2.56.1
Armin Wolf
maintainerPATCH 2/2 platform/x86: dell-wmi-aio: Ignore HDMI Input event
Event 0xDDF2 is used to signal that the HDMI input was enabled. Ignore this event since the feature seems to work fine without any userspace interaction required.
--- drivers/platform/x86/dell/dell-wmi-aio.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/dell/dell-wmi-aio.c +1 -0
@@ -53,6 +53,7 @@ static const struct key_entry dell_wmi_aio_keymap[] = { { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } }, { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } }, { KE_KEY, 0xe00b, { KEY_SWITCHVIDEOMODE } }, + { KE_IGNORE, 0xddf2, { KEY_UNKNOWN } }, /* HDMI Input enabled */ { KE_END, 0 } };
Signature · 1 line
2.56.1
Armin Wolf
maintainerRe: [PATCH 2/2] platform/x86: dell-wmi-aio: Ignore HDMI Input event
Am 17.11.26 um 22:45 schrieb Armin Wolf:
Quoted 3 lines
Event
0xDDF2is used to signal that the HDMI input was enabled. Ignore this event since the feature seems to work fine without any userspace interaction required.
I forgot to ask Teodora if this patch is appropriate, so please wait till Teodora as given her OK on this patch.
Thanks,
Armin Wolf
Quoted 17 lines
Signed-off-by Armin Wolf <[email protected]>--- drivers/platform/x86/dell/dell-wmi-aio.c | 1 + 1 file changed, 1 insertion(+)drivers/platform/x86/dell/dell-wmi-aio.c +1
-0@@ -53,6 +53,7 @@ static const struct key_entry dell_wmi_aio_keymap[] = { { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } }, { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } }, { KE_KEY, 0xe00b, { KEY_SWITCHVIDEOMODE } }, + { KE_IGNORE, 0xddf2, { KEY_UNKNOWN } }, /* HDMI Input enabled */ { KE_END, 0 } };
Ilpo Järvinen
maintainerQuoted 4 lines · Armin Wolf
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.
Quoted 90 lines
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 <[email protected]>Tested-by Teodora <[email protected]>Signed-off-by Armin Wolf <[email protected]>--- 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.cDocumentation/wmi/devices/dell-wmi-pega.rst new file +66
-0@@ -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()
Documentation/wmi/devices/dell-wmi-pega.rst line 76
Quoted 10 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +10
-0+------------------------------------ + +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).
Quoted 76 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +5
-0+WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlight brightness. See +``PegaOemNotificationBrightnessUP()`` for details.MAINTAINERS +6
-0@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]drivers/platform/x86/dell/Kconfig +13
-0@@ -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 mdrivers/platform/x86/dell/Makefile +1
-0@@ -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.odrivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0@@ -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 <[email protected]> +*
drivers/platform/x86/dell/dell-wmi-pega.c line 16
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-0+* Based on earlier work by Teodora <[email protected]>. +*/ + +#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).
Quoted 19 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +19
-0+#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 = { };
drivers/platform/x86/dell/dell-wmi-pega.c line 45
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-0+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()
drivers/platform/x86/dell/dell-wmi-pega.c line 58
Quoted 13 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +13
-0+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.
Quoted 25 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +25
-0+ +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,
drivers/platform/x86/dell/dell-wmi-pega.c line 93
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-0+ .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 <[email protected]>" ); +MODULE_DESCRIPTION ("Dell All-In-One series platform integration" ); +MODULE_LICENSE ("GPL" );
Just the mandatory nitpicking :-), seems fine otherwise.
Signature · 1 line
i.
Armin Wolf
maintainerAm 17.11.26 um 23:17 schrieb Ilpo Järvinen:
Quoted 105 lines · Armin Wolf
Quoted 5 lines
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.
Quoted 95 lines
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 <[email protected]>Tested-by Teodora <[email protected]>Signed-off-by Armin Wolf <[email protected]>--- 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.rstcreate mode 100644drivers/platform/x86/dell/dell-wmi-pega.cDocumentation/wmi/devices/dell-wmi-pega.rst new file +71
-0@@ -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()
Quoted 8 lines
Documentation/wmi/devices/dell-wmi-pega.rst line 76
Quoted 5 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +5
-0+-------------------------------------------- + +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).
Sure, will do.
Quoted 89 lines
Quoted 76 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +5
-0+WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlight brightness. See +``PegaOemNotificationBrightnessUP()`` for details.MAINTAINERS +6
-0@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]drivers/platform/x86/dell/Kconfig +13
-0@@ -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 mdrivers/platform/x86/dell/Makefile +1
-0@@ -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.odrivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0@@ -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 <[email protected]> +* drivers/platform/x86/dell/dell-wmi-pega.c line 16
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-0+* Based on earlier work by Teodora <[email protected]>. +*/ + +#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?
Quoted 2 lines
I suspect direct
device.hinclude isn't necessary either (and it's anyway guaranteed to come throughwmi.h).
Good question, i copied it from one of the other WMI drivers.
I will remove both includes in the next revision.
Quoted 24 lines
Quoted 24 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +23
-0+#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));
Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 45
Quoted 6 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+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()
What would be the correct include for this?
Quoted 46 lines
Quoted 4 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +3
-0+return -EIO ; + +return 0 ;drivers/platform/x86/dell/dell-wmi-pega.c line 58
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-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.
Quoted 29 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +29
-0+ +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,
Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 93
Quoted 6 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+}; +module_wmi_driver (dell_wmi_pega_driver); + +MODULE_AUTHOR ("Armin Wolf <[email protected]>" ); +MODULE_DESCRIPTION ("Dell All-In-One series platform integration" ); +MODULE_LICENSE ("GPL" );Just the mandatory nitpicking :-), seems fine otherwise.
Thanks,
i will wait with sending a v2 until Teodora has tested the second patch.
Thanks,
Armin Wolf
Ilpo Järvinen
maintainerQuoted 227 lines · Armin Wolf
Am 17.11.26 um 23:17 schrieb Ilpo Järvinen:
Quoted 120 lines · Armin Wolf
Quoted 5 lines
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.
Quoted 110 lines
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 <[email protected]>Closes:
https://lore.kernel.org/platform-driver-x86/[email protected]Tested-by Teodora <[email protected]>Signed-off-by Armin Wolf <[email protected]>--- 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.rstcreate mode 100644drivers/platform/x86/dell/dell-wmi-pega.cDocumentation/wmi/devices/dell-wmi-pega.rst new file +10
-0@@ -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 theunderlying platform
+of various OS-specific events like power up, shutdown and backlight brightness control.Documentation/wmi/devices/dell-wmi-pega.rst new file +2
-0+ +Not implementing support for this WMI device might prevent hotkeysexposed over WMI from
Documentation/wmi/devices/dell-wmi-pega.rst new file +6
-0+working on some models. + +WMI interface description +========================= + +The WMI interface description can be decoded from the embedded binary MOF(bmof)
Documentation/wmi/devices/dell-wmi-pega.rst new file +18
-0+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);
Documentation/wmi/devices/dell-wmi-pega.rst new file +4
-0+ + [WmiMethodId(2), Implemented, read, write, + Description("Invoked by AP when system is going to off state.")] + void PegaOemNotificationStop([out, Description("Return Value")] uint32RetVal);
Documentation/wmi/devices/dell-wmi-pega.rst new file +4
-0+ + [WmiMethodId(3), Implemented, read, write, + Description("Invoked by Application to tune up brightness.")] + void PegaOemNotificationBrightnessUP([out, Description("ReturnValue")] uint32 RetVal);
Documentation/wmi/devices/dell-wmi-pega.rst new file +4
-0+ + [WmiMethodId(4), Implemented, read, write, + Description("Invoked by Application to tune down brightness.")] + void PegaOemNotificationBrightnessDown([out, Description("ReturnValue")] uint32 RetVal);
Documentation/wmi/devices/dell-wmi-pega.rst new file +3
-0+ + [WmiMethodId(5), Implemented, read, write, Description("Reserved.")] + void PegaOemNotificationRSVD1([out, Description("Return Value")]uint32 RetVal);
Documentation/wmi/devices/dell-wmi-pega.rst new file +3
-0+ + [WmiMethodId(6), Implemented, read, write, Description("Reserved.")] + void PegaOemNotificationRSVD2([out, Description("Return Value")]uint32 RetVal);
+ };Documentation/wmi/devices/dell-wmi-pega.rst new file +7
-0+ +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 WMImethod also enables
Documentation/wmi/devices/dell-wmi-pega.rst new file +10
-0+reporting of hotkey events over WMI. + +WMI method PegaOemNotificationStop() +------------------------------------ + +Notifies the platform that the OS is shutting down. + +WMI method PegaOemNotificationBrightnessUP() +-------------------------------------------- +Quoted 8 lines
Quoted 5 lines
+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).
Sure, will do.
Quoted 95 lines
Quoted 82 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +4
-0+WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlightbrightness. See +``PegaOemNotificationBrightnessUP()`` for details.
MAINTAINERS +5
-0@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]drivers/platform/x86/dell/Kconfig +6
-0@@ -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 DellAll-In-One machines.
drivers/platform/x86/dell/Kconfig +1
-0+ This driver is necessary for enabling the delivery of hotkey eventsto the dell-wmi-aio
drivers/platform/x86/dell/Kconfig +3
-0+ driver on some machines. + + To compile this drivers as a module, choose M here: the module willbe called
drivers/platform/x86/dell/Kconfig +2
-0+ dell-wmi-pega. + config DELL_WMI_SYSMAN tristate "Dell WMI-based Systems management driver" default mdrivers/platform/x86/dell/Makefile +0
-0@@ -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.odrivers/platform/x86/dell/Makefile +1
-0+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.odrivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0@@ -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 <[email protected]> +* drivers/platform/x86/dell/dell-wmi-pega.c line 16
Quoted 10 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +10
-0+* Based on earlier work by Teodora <[email protected]>. +*/ + +#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?
Quoted 4 lines
Quoted 2 lines
I suspect direct
device.hinclude isn't necessary either (and it's anyway guaranteed to come throughwmi.h).Good question, i copied it from one of the other WMI drivers.
Thanks how they usually end up everywhere. kernel.h is very rarely needed these days.
Quoted 37 lines
I will remove both includes in the next revision.
Quoted 26 lines
Quoted 26 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +17
-0+#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_methodmethod)drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+{ +struct wmi_buffer input = { }; +struct wmi_buffer output; +int ret; + + ret = wmidev_invoke_method(wdev, 0x0, method, &input, &output,
sizeof(__le32));Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 45
Quoted 6 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+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()
Quoted 1 line
What would be the correct include for this?
linux/byteorder/generic.h
Signature · 1 line
i.
Quoted 64 lines
Quoted 48 lines
Quoted 14 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+return -EIO ; + +return 0 ; +} + +static int dell_wmi_pega_probe(struct wmi_device *wdev, const void*context)
drivers/platform/x86/dell/dell-wmi-pega.c new file +7
-0+{ +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 hotkeysQuoted 1 line
might not work\n");
braces for multiline constructs.
Quoted 30 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +11
-0+ +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 ofshutdown\n");
drivers/platform/x86/dell/dell-wmi-pega.c new file +18
-0+} + +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,Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 93
Quoted 6 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +6
-0+}; +module_wmi_driver (dell_wmi_pega_driver); + +MODULE_AUTHOR ("Armin Wolf <[email protected]>" ); +MODULE_DESCRIPTION ("Dell All-In-One series platform integration" ); +MODULE_LICENSE ("GPL" );Just the mandatory nitpicking :-), seems fine otherwise.
Thanks,
i will wait with sending a v2 until Teodora has tested the second patch.
Thanks,
Armin Wolf
Hi all - please proceed with the patch and thank you all for your work!
Sent from my mighty iPhone 13 mini
Quoted 297 lines · Armin Wolf
Am 17.11.26 um 23:17 schrieb Ilpo Järvinen:
Quoted 101 lines
Quoted 5 lines · Armin Wolf
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.
Quoted 94 lines
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 <[email protected]>Tested-by Teodora <[email protected]>Signed-off-by Armin Wolf <[email protected]>--- 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.cDocumentation/wmi/devices/dell-wmi-pega.rst new file +70
-0@@ -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. +Quoted 8 lines
Documentation/wmi/devices/dell-wmi-pega.rst line 76
Quoted 6 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +6
-0+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).
Sure, will do.
Quoted 79 lines
Quoted 79 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +5
-0+WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlight brightness. See +``PegaOemNotificationBrightnessUP()`` for details.MAINTAINERS +5
-0@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]drivers/platform/x86/dell/Kconfig +12
-0@@ -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 mdrivers/platform/x86/dell/Makefile +1
-0@@ -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.odrivers/platform/x86/dell/dell-wmi-pega.c new file +11
-0@@ -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 <[email protected]> +* +* Based on earlier work by Teodora <[email protected]>. +*/ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 16
Quoted 5 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +5
-0+#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 directdevice.hinclude isn't necessary either (and it's anyway guaranteed to come throughwmi.h).Good question, i copied it from one of the other WMI drivers.
I will remove both includes in the next revision.
Quoted 22 lines
Quoted 22 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +22
-0+#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; +Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 45
Quoted 7 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +7
-0+ 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()What would be the correct include for this?
Quoted 42 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 58
Quoted 13 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +13
-0+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.
Quoted 28 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +28
-0+ +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,Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 93
Quoted 7 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +7
-0+ .no_singleton = true, +}; +module_wmi_driver (dell_wmi_pega_driver); + +MODULE_AUTHOR ("Armin Wolf <[email protected]>" ); +MODULE_DESCRIPTION ("Dell All-In-One series platform integration" ); +MODULE_LICENSE ("GPL" );Just the mandatory nitpicking :-), seems fine otherwise.
Thanks,
i will wait with sending a v2 until Teodora has tested the second patch.
Thanks,
Armin Wolf
Armin Wolf
maintainerAm 18.11.26 um 07:24 schrieb [email protected]:
Quoted 3 lines
Hi all - please proceed with the patch and thank you all for your work!
Sent from my mighty iPhone 13 mini
Thanks, did you check the second patch as well? This one was not included in the custom module i send you, so i want to make sure that said patch does not break the event handling.
Thanks,
Armin Wolf
Quoted 293 lines
Quoted 293 lines · Armin Wolf
Am 17.11.26 um 23:17 schrieb Ilpo Järvinen:
Quoted 101 lines
Quoted 5 lines · Armin Wolf
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.
Quoted 94 lines
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 <[email protected]>Tested-by Teodora <[email protected]>Signed-off-by Armin Wolf <[email protected]>--- 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.rstcreate mode 100644drivers/platform/x86/dell/dell-wmi-pega.cDocumentation/wmi/devices/dell-wmi-pega.rst new file +70
-0@@ -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. +Quoted 8 lines
Documentation/wmi/devices/dell-wmi-pega.rst line 76
Quoted 6 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +6
-0+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).
Sure, will do.
Quoted 79 lines
Quoted 79 lines
Documentation/wmi/devices/dell-wmi-pega.rst new file +5
-0+WMI method PegaOemNotificationBrightnessDown() +---------------------------------------------- + +Notifies the platform that the user wants to decrease the backlight brightness. See +``PegaOemNotificationBrightnessUP()`` for details.MAINTAINERS +5
-0@@ -7534,6 +7534,12 @@ M: Pali Rohár <[email protected]> S: Maintained F: drivers/platform/x86/dell/dell-wmi-base.c +DELL WMI PEGA DRIVER +M: Armin Wolf <[email protected]> +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 <[email protected]> L: [email protected]drivers/platform/x86/dell/Kconfig +12
-0@@ -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 mdrivers/platform/x86/dell/Makefile +1
-0@@ -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.odrivers/platform/x86/dell/dell-wmi-pega.c new file +11
-0@@ -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 <[email protected]> +* +* Based on earlier work by Teodora <[email protected]>. +*/ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 16
Quoted 5 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +5
-0+#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 directdevice.hinclude isn't necessary either (and it's anyway guaranteed to come throughwmi.h).Good question, i copied it from one of the other WMI drivers.
I will remove both includes in the next revision.
Quoted 22 lines
Quoted 22 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +22
-0+#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; +Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 45
Quoted 7 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +7
-0+ 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()What would be the correct include for this?
Quoted 42 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 58
Quoted 13 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +13
-0+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.
Quoted 28 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +28
-0+ +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,Quoted 8 lines
drivers/platform/x86/dell/dell-wmi-pega.c line 93
Quoted 7 lines
drivers/platform/x86/dell/dell-wmi-pega.c new file +7
-0+ .no_singleton = true, +}; +module_wmi_driver (dell_wmi_pega_driver); + +MODULE_AUTHOR ("Armin Wolf <[email protected]>" ); +MODULE_DESCRIPTION ("Dell All-In-One series platform integration" ); +MODULE_LICENSE ("GPL" );Just the mandatory nitpicking :-), seems fine otherwise.
Thanks,
i will wait with sending a v2 until Teodora has tested the second patch.
Thanks,
Armin Wolf