[PATCH 0/2] platform/x86: asus-wmi: fix and unify keyboard brightness key handling
From: Bartu Alev
Date: Sun Oct 25 2026 - 14:29:56 EST
The WMI hotkey path and the HID event path in asus-wmi step the
keyboard backlight with two separate copies of the same arithmetic, and
the two copies disagree. The WMI copy stores the new level without
clamping it, so holding brightness-down at zero drives the cached level
one step below zero per keypress, the "value >= 0" apply check then
drops every following transition, and the hardware-changed notification
hands the wrapped negative to userspace as 4294967294+. Pressing
brightness-up at maximum reports 4, above max_brightness.
The first patch fixes the bounds on its own, so stable trees can pick
it up without the rest of the series. The second patch removes the
duplication: both paths now step through one shared helper that reads,
computes, and writes the level inside a single hold of asus_ref.lock.
With the series applied the level stays
within [0, ASUS_EV_MAX_BRIGHTNESS] on every transition and userspace
sees no wrapped or out-of-range values.
Signed-off-by: Bartu Alev <bartualev@xxxxxxxxx>
---
Bartu Alev (2):
platform/x86: asus-wmi: clamp keyboard brightness hotkey updates
platform/x86: asus-wmi: unify WMI and HID keyboard brightness stepping
drivers/platform/x86/asus-wmi.c | 79 +++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 39 deletions(-)
---
base-commit: 9d3475065167197742b0882aff21cf8e78393277
change-id: 20261025-b4-asus-kbd-fixes-6c7e3780597b
Best regards,
--
Bartu Alev <bartualev@xxxxxxxxx>