Skip to contentSkip to conversation

platform/x86: msi-wmi: Fix hotkeys dropped with vendor backlight

PATCH In review Patryk Pilichowski 2 participants 2 messages Sep 25 – Oct 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: msi-wmi: Fix hotkeys dropped with vendor backlight

Commit dee82409a883 ("platform/x86: msi-wmi: Reformat msi_wmi_notify()") turned the condition for reporting a hotkey into an early return, but only negated the brightness key comparisons, not the backlight check. As a result, when the driver registers its own backlight device, all WMI hotkeys are now dropped, instead of all of them being reported as before.

Restore the original behavior: only drop the brightness keys, and only when brightness is handled by the ACPI video driver.

This was found by code inspection. It is not tested on hardware that uses the vendor backlight; on an MSI Katana 15 B13VFK (no vendor backlight) hotkey handling is unchanged.

Fixes dee82409a883 ("platform/x86: msi-wmi: Reformat msi_wmi_notify()")
---
 drivers/platform/x86/msi-wmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/msi-wmi.c +3 -3
index c9db750fe5..05c35133a1 100644
@@ -236,9 +236,9 @@ static void msi_wmi_notify(union acpi_object *obj, void *context)
 	}
 
 	/* Brightness is served via acpi video driver */
-	if (key->type == KE_KEY &&
-	    (backlight || (key->code == MSI_KEY_BRIGHTNESSUP ||
-			   key->code == MSI_KEY_BRIGHTNESSDOWN)))
+	if (key->type == KE_KEY && !backlight &&
+	    (key->code == MSI_KEY_BRIGHTNESSUP ||
+	     key->code == MSI_KEY_BRIGHTNESSDOWN))
 		return;
 
 	pr_debug("Send key: 0x%X - Input layer keycode: %d\n", key->code, key->keycode);
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 8 lines · Patryk Pilichowski

Commit dee82409a883 ("platform/x86: msi-wmi: Reformat msi_wmi_notify()") turned the condition for reporting a hotkey into an early return, but only negated the brightness key comparisons, not the backlight check. As a result, when the driver registers its own backlight device, all WMI hotkeys are now dropped, instead of all of them being reported as before.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.

The list of commits applied:
[1/1] platform/x86: msi-wmi: Fix hotkeys dropped with vendor backlight

      commit: 48d84a375dca6c561fcaa4e697661cfee3e72fcb

--
i.