diff mbox series

[v2,2/2] dell-wmi-base: Handle META key Lock/Unlock events

Message ID 20241031154441.6663-2-kuurtb@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Hans de Goede
Headers show
Series [v2,1/2] dell-smbios-base: Extends support to Alienware products | expand

Commit Message

Kurt Borja Oct. 31, 2024, 3:44 p.m. UTC
Some Alienware devices have a key that locks/unlocks the Meta key. This
key triggers a WMI event that should be ignored by the kernel, as it's
handled by internally the firmware.

There is no known way of changing this default behavior. The firmware
would lock/unlock the Meta key, regardless of how the event is handled.

Tested on an Alienware x15 R1.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
v2:
 - Fixed entry style
 - Commit message clarifies firmware behavior
 - Commit message now has "Tested on"
---
 drivers/platform/x86/dell/dell-wmi-base.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Mario Limonciello Oct. 31, 2024, 3:53 p.m. UTC | #1
On 10/31/2024 10:44, Kurt Borja wrote:
> Some Alienware devices have a key that locks/unlocks the Meta key. This
> key triggers a WMI event that should be ignored by the kernel, as it's
> handled by internally the firmware.
> 
> There is no known way of changing this default behavior. The firmware
> would lock/unlock the Meta key, regardless of how the event is handled.
> 

Thinking through why this event exists, it's probably so that there can 
be a toast message or popup or something similar in Windows to show an 
icon that it was changed, which doesn't currently exist in Linux.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> Tested on an Alienware x15 R1.
> 
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> v2:
>   - Fixed entry style
>   - Commit message clarifies firmware behavior
>   - Commit message now has "Tested on"
> ---
>   drivers/platform/x86/dell/dell-wmi-base.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
> index 502783a7a..ce421e51b 100644
> --- a/drivers/platform/x86/dell/dell-wmi-base.c
> +++ b/drivers/platform/x86/dell/dell-wmi-base.c
> @@ -80,6 +80,12 @@ static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = {
>   static const struct key_entry dell_wmi_keymap_type_0000[] = {
>   	{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
>   
> +	/* Meta key lock */
> +	{ KE_IGNORE, 0xe000, { KEY_RIGHTMETA } },
> +
> +	/* Meta key unlock */
> +	{ KE_IGNORE, 0xe001, { KEY_RIGHTMETA } },
> +
>   	/* Key code is followed by brightness level */
>   	{ KE_KEY,    0xe005, { KEY_BRIGHTNESSDOWN } },
>   	{ KE_KEY,    0xe006, { KEY_BRIGHTNESSUP } },
Pali Rohár Oct. 31, 2024, 6:19 p.m. UTC | #2
On Thursday 31 October 2024 12:44:42 Kurt Borja wrote:
> Some Alienware devices have a key that locks/unlocks the Meta key. This
> key triggers a WMI event that should be ignored by the kernel, as it's
> handled by internally the firmware.
> 
> There is no known way of changing this default behavior. The firmware
> would lock/unlock the Meta key, regardless of how the event is handled.
> 
> Tested on an Alienware x15 R1.
> 
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>

Acked-by: Pali Rohár <pali@kernel.org>

> ---
> v2:
>  - Fixed entry style
>  - Commit message clarifies firmware behavior
>  - Commit message now has "Tested on"
> ---
>  drivers/platform/x86/dell/dell-wmi-base.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
> index 502783a7a..ce421e51b 100644
> --- a/drivers/platform/x86/dell/dell-wmi-base.c
> +++ b/drivers/platform/x86/dell/dell-wmi-base.c
> @@ -80,6 +80,12 @@ static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = {
>  static const struct key_entry dell_wmi_keymap_type_0000[] = {
>  	{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
>  
> +	/* Meta key lock */
> +	{ KE_IGNORE, 0xe000, { KEY_RIGHTMETA } },
> +
> +	/* Meta key unlock */
> +	{ KE_IGNORE, 0xe001, { KEY_RIGHTMETA } },
> +
>  	/* Key code is followed by brightness level */
>  	{ KE_KEY,    0xe005, { KEY_BRIGHTNESSDOWN } },
>  	{ KE_KEY,    0xe006, { KEY_BRIGHTNESSUP } },
> -- 
> 2.47.0
>
diff mbox series

Patch

diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
index 502783a7a..ce421e51b 100644
--- a/drivers/platform/x86/dell/dell-wmi-base.c
+++ b/drivers/platform/x86/dell/dell-wmi-base.c
@@ -80,6 +80,12 @@  static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = {
 static const struct key_entry dell_wmi_keymap_type_0000[] = {
 	{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
 
+	/* Meta key lock */
+	{ KE_IGNORE, 0xe000, { KEY_RIGHTMETA } },
+
+	/* Meta key unlock */
+	{ KE_IGNORE, 0xe001, { KEY_RIGHTMETA } },
+
 	/* Key code is followed by brightness level */
 	{ KE_KEY,    0xe005, { KEY_BRIGHTNESSDOWN } },
 	{ KE_KEY,    0xe006, { KEY_BRIGHTNESSUP } },