* [PATCH] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
@ 2026-11-22 14:41 Martin Szathmari
2026-11-22 15:01 ` Denis Benato
2026-11-22 16:40 ` [PATCH v2] " Martin Szathmari
0 siblings, 2 replies; 6+ messages in thread
From: Martin Szathmari @ 2026-11-22 14:41 UTC (permalink / raw)
To: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Ilpo Järvinen
Cc: platform-driver-x86
asus-wmi always registers asus::kbd_backlight with max_brightness = 3
(ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
backlight only supports two states: levels 1, 2 and 3 all produce the
same, full brightness. Userspace therefore shows a 4-step control where
the top three steps are identical, and the backlight hotkey cycles
through steps that visibly do nothing.
This matches the vendor-supplied review unit tested by Notebookcheck,
which describes the B7402FEA as having "single-level key illumination".
Add a kbd_led_on_off quirk which registers the LED with
max_brightness = 1, and use the LED's max_brightness instead of
ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
toggle hotkey. For quirked models, also clamp the level read back from
firmware to 1. Enable the quirk for the B7402FEA via an exact DMI board
name match, keeping the default wmi_backlight_set_devstate behaviour.
Behaviour on models without the quirk is unchanged.
I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
version 9.0) with the change backported to v7.3.4: max_brightness reads
1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
toggles on/off, and KDE Plasma's keyboard brightness control shows
0%/100%.
Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
---
Note: This patch was developed with the help of an AI coding assistant
(Claude Opus 5.5). I reviewed the change and tested it myself on my
ASUS ExpertBook B7402FEA as described above.
drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
drivers/platform/asus/asus-wmi.c | 16 ++++++++++------
drivers/platform/asus/asus-wmi.h | 2 ++
3 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
index 3b0f3346d..9204213be 100644
--- a/drivers/platform/asus/asus-nb-wmi.c
+++ b/drivers/platform/asus/asus-nb-wmi.c
@@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
.key_wlan_event = ASUS_WMI_KEY_IGNORE,
};
+static struct quirk_entry quirk_asus_kbd_led_on_off = {
+ .wmi_backlight_set_devstate = true,
+ .kbd_led_on_off = true,
+};
+
static struct quirk_entry quirk_asus_z13 = {
.key_wlan_event = ASUS_WMI_KEY_ARMOURY,
.tablet_switch_mode = asus_wmi_kbd_dock_devid,
@@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_proart_px13,
},
+ {
+ .callback = dmi_matched,
+ .ident = "ASUS ExpertBook B7402FEA",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
+ },
+ .driver_data = &quirk_asus_kbd_led_on_off,
+ },
{},
};
diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
index b33ebdb21..2e06aac9a 100644
--- a/drivers/platform/asus/asus-wmi.c
+++ b/drivers/platform/asus/asus-wmi.c
@@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
brightness -= 1;
break;
case ASUS_EV_BRTTOGGLE:
- if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
+ if (brightness >= asus->kbd_led.max_brightness)
brightness = 0;
else
brightness += 1;
break;
}
- asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
asus->kbd_led_notify = true;
queue_work(asus->led_workqueue, &asus->kbd_led_work);
return 0;
@@ -1922,8 +1922,11 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
if (retval < 0)
return retval;
- if (level)
+ if (level) {
*level = retval & 0x7F;
+ if (asus->driver->quirks->kbd_led_on_off)
+ *level = min(*level, 1);
+ }
if (env)
*env = (retval >> 8) & 0x7F;
return 0;
@@ -1937,7 +1940,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
asus = container_of(led_cdev, struct asus_wmi, kbd_led);
scoped_guard(spinlock_irqsave, &asus_ref.lock)
- asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
if (asus->kbd_led_avail)
kbd_led_update(asus);
@@ -2164,7 +2167,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
asus->kbd_led.brightness_set_blocking = kbd_led_set;
asus->kbd_led.brightness_get = kbd_led_get;
- asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
+ asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
+ 1 : ASUS_EV_MAX_BRIGHTNESS;
asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
@@ -4706,7 +4710,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
return;
}
if (code == NOTIFY_KBD_BRTTOGGLE) {
- if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
+ if (led_value >= asus->kbd_led.max_brightness)
kbd_led_set_by_kbd(asus, 0);
else
kbd_led_set_by_kbd(asus, led_value + 1);
diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
index b45f81b38..2a9060b6e 100644
--- a/drivers/platform/asus/asus-wmi.h
+++ b/drivers/platform/asus/asus-wmi.h
@@ -41,6 +41,8 @@ struct quirk_entry {
bool wmi_force_als_set;
bool wmi_ignore_fan;
bool filter_i8042_e1_extended_codes;
+ /* Keyboard backlight only supports on/off, not 3 levels */
+ bool kbd_led_on_off;
int key_wlan_event;
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
int wapf;
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
2026-11-22 14:41 [PATCH] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight Martin Szathmari
@ 2026-11-22 15:01 ` Denis Benato
2026-11-22 16:40 ` [PATCH v2] " Martin Szathmari
1 sibling, 0 replies; 6+ messages in thread
From: Denis Benato @ 2026-11-22 15:01 UTC (permalink / raw)
To: Martin Szathmari, Corentin Chary, Luke D. Jones, Hans de Goede,
Ilpo Järvinen
Cc: platform-driver-x86
On 11/22/26 15:41, Martin Szathmari wrote:
> asus-wmi always registers asus::kbd_backlight with max_brightness = 3
> (ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
> backlight only supports two states: levels 1, 2 and 3 all produce the
> same, full brightness. Userspace therefore shows a 4-step control where
> the top three steps are identical, and the backlight hotkey cycles
> through steps that visibly do nothing.
>
> This matches the vendor-supplied review unit tested by Notebookcheck,
> which describes the B7402FEA as having "single-level key illumination".
>
> Add a kbd_led_on_off quirk which registers the LED with
> max_brightness = 1, and use the LED's max_brightness instead of
> ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
> toggle hotkey. For quirked models, also clamp the level read back from
> firmware to 1. Enable the quirk for the B7402FEA via an exact DMI board
> name match, keeping the default wmi_backlight_set_devstate behaviour.
>
> Behaviour on models without the quirk is unchanged.
>
> I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
> version 9.0) with the change backported to v7.3.4: max_brightness reads
> 1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
> toggles on/off, and KDE Plasma's keyboard brightness control shows
> 0%/100%.
Hi Martin,
Thanks for your effort! I have a few comments, but generally it looks good,
just be mindful that there may be other pending patches about keyboard
lighting that may beed to go in before this one (I lost track of things
taken/not taken in my mind).
> Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
> Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
> ---
> Note: This patch was developed with the help of an AI coding assistant
> (Claude Opus 5.5). I reviewed the change and tested it myself on my
> ASUS ExpertBook B7402FEA as described above.
>
> drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
> drivers/platform/asus/asus-wmi.c | 16 ++++++++++------
> drivers/platform/asus/asus-wmi.h | 2 ++
> 3 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
> index 3b0f3346d..9204213be 100644
> --- a/drivers/platform/asus/asus-nb-wmi.c
> +++ b/drivers/platform/asus/asus-nb-wmi.c
> @@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
> .key_wlan_event = ASUS_WMI_KEY_IGNORE,
> };
>
> +static struct quirk_entry quirk_asus_kbd_led_on_off = {
> + .wmi_backlight_set_devstate = true,
> + .kbd_led_on_off = true,
> +};
> +
> static struct quirk_entry quirk_asus_z13 = {
> .key_wlan_event = ASUS_WMI_KEY_ARMOURY,
> .tablet_switch_mode = asus_wmi_kbd_dock_devid,
> @@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = &quirk_asus_proart_px13,
> },
> + {
> + .callback = dmi_matched,
> + .ident = "ASUS ExpertBook B7402FEA",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
> + },
> + .driver_data = &quirk_asus_kbd_led_on_off,
> + },
> {},
> };
>
> diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
> index b33ebdb21..2e06aac9a 100644
> --- a/drivers/platform/asus/asus-wmi.c
> +++ b/drivers/platform/asus/asus-wmi.c
> @@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
> brightness -= 1;
> break;
> case ASUS_EV_BRTTOGGLE:
> - if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
> + if (brightness >= asus->kbd_led.max_brightness)
> brightness = 0;
> else
> brightness += 1;
> break;
> }
>
> - asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
> asus->kbd_led_notify = true;
> queue_work(asus->led_workqueue, &asus->kbd_led_work);
> return 0;
> @@ -1922,8 +1922,11 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
> if (retval < 0)
> return retval;
>
> - if (level)
> + if (level) {
> *level = retval & 0x7F;
> + if (asus->driver->quirks->kbd_led_on_off)
> + *level = min(*level, 1);
Ternary operator instead? Or maybe, even better, just use min(*level, max_brightness) regardless
of the quirk.
like this:
*level = min(retval & 0x7F, max_level);
> + }
> if (env)
> *env = (retval >> 8) & 0x7F;
> return 0;
> @@ -1937,7 +1940,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
> asus = container_of(led_cdev, struct asus_wmi, kbd_led);
>
> scoped_guard(spinlock_irqsave, &asus_ref.lock)
> - asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
>
> if (asus->kbd_led_avail)
> kbd_led_update(asus);
> @@ -2164,7 +2167,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
> asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
> asus->kbd_led.brightness_set_blocking = kbd_led_set;
> asus->kbd_led.brightness_get = kbd_led_get;
> - asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
> + asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
> + 1 : ASUS_EV_MAX_BRIGHTNESS;
> asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
> INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
>
> @@ -4706,7 +4710,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
> return;
> }
> if (code == NOTIFY_KBD_BRTTOGGLE) {
> - if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
> + if (led_value >= asus->kbd_led.max_brightness)
> kbd_led_set_by_kbd(asus, 0);
> else
> kbd_led_set_by_kbd(asus, led_value + 1);
> diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
> index b45f81b38..2a9060b6e 100644
> --- a/drivers/platform/asus/asus-wmi.h
> +++ b/drivers/platform/asus/asus-wmi.h
> @@ -41,6 +41,8 @@ struct quirk_entry {
> bool wmi_force_als_set;
> bool wmi_ignore_fan;
> bool filter_i8042_e1_extended_codes;
> + /* Keyboard backlight only supports on/off, not 3 levels */
No other quirk has a comment there, why should this have one?
> + bool kbd_led_on_off;
> int key_wlan_event;
> enum asus_wmi_tablet_switch_mode tablet_switch_mode;
> int wapf;
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
2026-11-22 14:41 [PATCH] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight Martin Szathmari
2026-11-22 15:01 ` Denis Benato
@ 2026-11-22 16:40 ` Martin Szathmari
2026-11-22 16:56 ` Denis Benato
2026-11-22 17:18 ` [PATCH v3] " Martin Szathmari
1 sibling, 2 replies; 6+ messages in thread
From: Martin Szathmari @ 2026-11-22 16:40 UTC (permalink / raw)
To: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Ilpo Järvinen
Cc: platform-driver-x86
asus-wmi always registers asus::kbd_backlight with max_brightness = 3
(ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
backlight only supports two states: levels 1, 2 and 3 all produce the
same, full brightness. Userspace therefore shows a 4-step control where
the top three steps are identical, and the backlight hotkey cycles
through steps that visibly do nothing.
This matches the vendor-supplied review unit tested by Notebookcheck,
which describes the B7402FEA as having "single-level key illumination".
Add a kbd_led_on_off quirk which registers the LED with
max_brightness = 1, and use the LED's max_brightness instead of
ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
toggle hotkey. For quirked models, also clamp the level read back from
firmware to 1. Enable the quirk for the B7402FEA via an exact DMI board
name match, keeping the default wmi_backlight_set_devstate behaviour.
Behaviour on models without the quirk is unchanged.
I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
version 9.0) with the change backported to v7.3.4: max_brightness reads
1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
toggles on/off, and KDE Plasma's keyboard brightness control shows
0%/100%.
Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
---
Changes in v2:
- Use a ternary for the quirked clamp in kbd_led_read() (Denis Benato).
I kept the clamp limited to quirked models so that behaviour on all
other models stays strictly unchanged; happy to make it unconditional
if you prefer.
- Drop the comment on the new quirk_entry field (Denis Benato)
- Re-tested on the B7402FEA
v1: https://lore.kernel.org/platform-driver-x86/20261122144147.7916-1-martin.szathmari@gmail.com/
Based on pdx86 for-next; happy to rebase if other keyboard lighting
changes need to go in first.
Note: This patch was developed with the help of an AI coding assistant
(Claude Opus 5.5). I reviewed the change and tested it myself on my
ASUS ExpertBook B7402FEA as described above.
drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
drivers/platform/asus/asus-wmi.c | 14 ++++++++------
drivers/platform/asus/asus-wmi.h | 1 +
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
index 3b0f3346d..9204213be 100644
--- a/drivers/platform/asus/asus-nb-wmi.c
+++ b/drivers/platform/asus/asus-nb-wmi.c
@@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
.key_wlan_event = ASUS_WMI_KEY_IGNORE,
};
+static struct quirk_entry quirk_asus_kbd_led_on_off = {
+ .wmi_backlight_set_devstate = true,
+ .kbd_led_on_off = true,
+};
+
static struct quirk_entry quirk_asus_z13 = {
.key_wlan_event = ASUS_WMI_KEY_ARMOURY,
.tablet_switch_mode = asus_wmi_kbd_dock_devid,
@@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_proart_px13,
},
+ {
+ .callback = dmi_matched,
+ .ident = "ASUS ExpertBook B7402FEA",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
+ },
+ .driver_data = &quirk_asus_kbd_led_on_off,
+ },
{},
};
diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
index b33ebdb21..0b85308b8 100644
--- a/drivers/platform/asus/asus-wmi.c
+++ b/drivers/platform/asus/asus-wmi.c
@@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
brightness -= 1;
break;
case ASUS_EV_BRTTOGGLE:
- if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
+ if (brightness >= asus->kbd_led.max_brightness)
brightness = 0;
else
brightness += 1;
break;
}
- asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
asus->kbd_led_notify = true;
queue_work(asus->led_workqueue, &asus->kbd_led_work);
return 0;
@@ -1923,7 +1923,8 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
return retval;
if (level)
- *level = retval & 0x7F;
+ *level = asus->driver->quirks->kbd_led_on_off ?
+ min(retval & 0x7F, 1) : retval & 0x7F;
if (env)
*env = (retval >> 8) & 0x7F;
return 0;
@@ -1937,7 +1938,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
asus = container_of(led_cdev, struct asus_wmi, kbd_led);
scoped_guard(spinlock_irqsave, &asus_ref.lock)
- asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
if (asus->kbd_led_avail)
kbd_led_update(asus);
@@ -2164,7 +2165,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
asus->kbd_led.brightness_set_blocking = kbd_led_set;
asus->kbd_led.brightness_get = kbd_led_get;
- asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
+ asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
+ 1 : ASUS_EV_MAX_BRIGHTNESS;
asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
@@ -4706,7 +4708,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
return;
}
if (code == NOTIFY_KBD_BRTTOGGLE) {
- if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
+ if (led_value >= asus->kbd_led.max_brightness)
kbd_led_set_by_kbd(asus, 0);
else
kbd_led_set_by_kbd(asus, led_value + 1);
diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
index b45f81b38..74e30a2d7 100644
--- a/drivers/platform/asus/asus-wmi.h
+++ b/drivers/platform/asus/asus-wmi.h
@@ -41,6 +41,7 @@ struct quirk_entry {
bool wmi_force_als_set;
bool wmi_ignore_fan;
bool filter_i8042_e1_extended_codes;
+ bool kbd_led_on_off;
int key_wlan_event;
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
int wapf;
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
2026-11-22 16:40 ` [PATCH v2] " Martin Szathmari
@ 2026-11-22 16:56 ` Denis Benato
2026-11-22 17:18 ` [PATCH v3] " Martin Szathmari
1 sibling, 0 replies; 6+ messages in thread
From: Denis Benato @ 2026-11-22 16:56 UTC (permalink / raw)
To: Martin Szathmari, Corentin Chary, Luke D. Jones, Hans de Goede,
Ilpo Järvinen
Cc: platform-driver-x86
On 11/22/26 17:40, Martin Szathmari wrote:
> asus-wmi always registers asus::kbd_backlight with max_brightness = 3
> (ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
> backlight only supports two states: levels 1, 2 and 3 all produce the
> same, full brightness. Userspace therefore shows a 4-step control where
> the top three steps are identical, and the backlight hotkey cycles
> through steps that visibly do nothing.
>
> This matches the vendor-supplied review unit tested by Notebookcheck,
> which describes the B7402FEA as having "single-level key illumination".
>
> Add a kbd_led_on_off quirk which registers the LED with
> max_brightness = 1, and use the LED's max_brightness instead of
> ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
> toggle hotkey. For quirked models, also clamp the level read back from
> firmware to 1. Enable the quirk for the B7402FEA via an exact DMI board
> name match, keeping the default wmi_backlight_set_devstate behaviour.
>
> Behaviour on models without the quirk is unchanged.
>
> I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
> version 9.0) with the change backported to v7.3.4: max_brightness reads
> 1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
> toggles on/off, and KDE Plasma's keyboard brightness control shows
> 0%/100%.
>
> Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
> Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
> ---
> Changes in v2:
> - Use a ternary for the quirked clamp in kbd_led_read() (Denis Benato).
> I kept the clamp limited to quirked models so that behaviour on all
> other models stays strictly unchanged; happy to make it unconditional
> if you prefer.
> - Drop the comment on the new quirk_entry field (Denis Benato)
> - Re-tested on the B7402FEA
>
> v1: https://lore.kernel.org/platform-driver-x86/20261122144147.7916-1-martin.szathmari@gmail.com/
>
> Based on pdx86 for-next; happy to rebase if other keyboard lighting
> changes need to go in first.
>
> Note: This patch was developed with the help of an AI coding assistant
> (Claude Opus 5.5). I reviewed the change and tested it myself on my
> ASUS ExpertBook B7402FEA as described above.
>
> drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
> drivers/platform/asus/asus-wmi.c | 14 ++++++++------
> drivers/platform/asus/asus-wmi.h | 1 +
> 3 files changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
> index 3b0f3346d..9204213be 100644
> --- a/drivers/platform/asus/asus-nb-wmi.c
> +++ b/drivers/platform/asus/asus-nb-wmi.c
> @@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
> .key_wlan_event = ASUS_WMI_KEY_IGNORE,
> };
>
> +static struct quirk_entry quirk_asus_kbd_led_on_off = {
> + .wmi_backlight_set_devstate = true,
> + .kbd_led_on_off = true,
> +};
> +
> static struct quirk_entry quirk_asus_z13 = {
> .key_wlan_event = ASUS_WMI_KEY_ARMOURY,
> .tablet_switch_mode = asus_wmi_kbd_dock_devid,
> @@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = &quirk_asus_proart_px13,
> },
> + {
> + .callback = dmi_matched,
> + .ident = "ASUS ExpertBook B7402FEA",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
> + },
> + .driver_data = &quirk_asus_kbd_led_on_off,
> + },
> {},
> };
>
> diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
> index b33ebdb21..0b85308b8 100644
> --- a/drivers/platform/asus/asus-wmi.c
> +++ b/drivers/platform/asus/asus-wmi.c
> @@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
> brightness -= 1;
> break;
> case ASUS_EV_BRTTOGGLE:
> - if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
> + if (brightness >= asus->kbd_led.max_brightness)
> brightness = 0;
> else
> brightness += 1;
> break;
> }
>
> - asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
> asus->kbd_led_notify = true;
> queue_work(asus->led_workqueue, &asus->kbd_led_work);
> return 0;
> @@ -1923,7 +1923,8 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
> return retval;
>
> if (level)
> - *level = retval & 0x7F;
> + *level = asus->driver->quirks->kbd_led_on_off ?
> + min(retval & 0x7F, 1) : retval & 0x7F;
I'm not understanding why you are checking the quirk here when a min(..., max_level) is
enough.
Generally one either goes for the ternary or for the unified one unless there is a problem,
but I am not seeing one.
You can answer me no problem if I need to know something I am not considering.
If not go for the suggested code I gave you before.
Thanks!
> if (env)
> *env = (retval >> 8) & 0x7F;
> return 0;
> @@ -1937,7 +1938,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
> asus = container_of(led_cdev, struct asus_wmi, kbd_led);
>
> scoped_guard(spinlock_irqsave, &asus_ref.lock)
> - asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
>
> if (asus->kbd_led_avail)
> kbd_led_update(asus);
> @@ -2164,7 +2165,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
> asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
> asus->kbd_led.brightness_set_blocking = kbd_led_set;
> asus->kbd_led.brightness_get = kbd_led_get;
> - asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
> + asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
> + 1 : ASUS_EV_MAX_BRIGHTNESS;
> asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
> INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
>
> @@ -4706,7 +4708,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
> return;
> }
> if (code == NOTIFY_KBD_BRTTOGGLE) {
> - if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
> + if (led_value >= asus->kbd_led.max_brightness)
> kbd_led_set_by_kbd(asus, 0);
> else
> kbd_led_set_by_kbd(asus, led_value + 1);
> diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
> index b45f81b38..74e30a2d7 100644
> --- a/drivers/platform/asus/asus-wmi.h
> +++ b/drivers/platform/asus/asus-wmi.h
> @@ -41,6 +41,7 @@ struct quirk_entry {
> bool wmi_force_als_set;
> bool wmi_ignore_fan;
> bool filter_i8042_e1_extended_codes;
> + bool kbd_led_on_off;
> int key_wlan_event;
> enum asus_wmi_tablet_switch_mode tablet_switch_mode;
> int wapf;
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v3] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
2026-11-22 16:40 ` [PATCH v2] " Martin Szathmari
2026-11-22 16:56 ` Denis Benato
@ 2026-11-22 17:18 ` Martin Szathmari
2026-11-22 17:21 ` Denis Benato
1 sibling, 1 reply; 6+ messages in thread
From: Martin Szathmari @ 2026-11-22 17:18 UTC (permalink / raw)
To: Corentin Chary, Luke D . Jones, Denis Benato
Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86
asus-wmi always registers asus::kbd_backlight with max_brightness = 3
(ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
backlight only supports two states: levels 1, 2 and 3 all produce the
same, full brightness. Userspace therefore shows a 4-step control where
the top three steps are identical, and the backlight hotkey cycles
through steps that visibly do nothing.
This matches the vendor-supplied review unit tested by Notebookcheck,
which describes the B7402FEA as having "single-level key illumination".
Add a kbd_led_on_off quirk which registers the LED with
max_brightness = 1, and use the LED's max_brightness instead of
ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
toggle hotkey. Also clamp the level read back from firmware to the LED's
max_brightness. Enable the quirk for the B7402FEA via an exact DMI board
name match, keeping the default wmi_backlight_set_devstate behaviour.
On models without the quirk the clamp is to 3, so it only has an
effect if firmware reports an out-of-range level.
I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
version 9.0) with the change backported to v7.3.4: max_brightness reads
1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
toggles on/off, and KDE Plasma's keyboard brightness control shows
0%/100%.
Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
---
Changes in v3:
- Clamp the level read back in kbd_led_read() to max_brightness
unconditionally instead of only for quirked models (Denis Benato)
- Re-tested on the B7402FEA
v2: https://lore.kernel.org/platform-driver-x86/20261122164034.7175-1-martin.szathmari@gmail.com/
Changes in v2:
- Use a ternary for the quirked clamp in kbd_led_read() (Denis Benato)
- Drop the comment on the new quirk_entry field (Denis Benato)
- Re-tested on the B7402FEA
v1: https://lore.kernel.org/platform-driver-x86/20261122144147.7916-1-martin.szathmari@gmail.com/
Based on pdx86 for-next; happy to rebase if other keyboard lighting
changes need to go in first.
Note: This patch was developed with the help of an AI coding assistant
(Claude Opus 5.5). I reviewed the change and tested it myself on my
ASUS ExpertBook B7402FEA as described above.
drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
drivers/platform/asus/asus-wmi.c | 13 +++++++------
drivers/platform/asus/asus-wmi.h | 1 +
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
index 3b0f3346d..9204213be 100644
--- a/drivers/platform/asus/asus-nb-wmi.c
+++ b/drivers/platform/asus/asus-nb-wmi.c
@@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
.key_wlan_event = ASUS_WMI_KEY_IGNORE,
};
+static struct quirk_entry quirk_asus_kbd_led_on_off = {
+ .wmi_backlight_set_devstate = true,
+ .kbd_led_on_off = true,
+};
+
static struct quirk_entry quirk_asus_z13 = {
.key_wlan_event = ASUS_WMI_KEY_ARMOURY,
.tablet_switch_mode = asus_wmi_kbd_dock_devid,
@@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_proart_px13,
},
+ {
+ .callback = dmi_matched,
+ .ident = "ASUS ExpertBook B7402FEA",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
+ },
+ .driver_data = &quirk_asus_kbd_led_on_off,
+ },
{},
};
diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
index b33ebdb21..f99512d29 100644
--- a/drivers/platform/asus/asus-wmi.c
+++ b/drivers/platform/asus/asus-wmi.c
@@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
brightness -= 1;
break;
case ASUS_EV_BRTTOGGLE:
- if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
+ if (brightness >= asus->kbd_led.max_brightness)
brightness = 0;
else
brightness += 1;
break;
}
- asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
asus->kbd_led_notify = true;
queue_work(asus->led_workqueue, &asus->kbd_led_work);
return 0;
@@ -1923,7 +1923,7 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
return retval;
if (level)
- *level = retval & 0x7F;
+ *level = min(retval & 0x7F, asus->kbd_led.max_brightness);
if (env)
*env = (retval >> 8) & 0x7F;
return 0;
@@ -1937,7 +1937,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
asus = container_of(led_cdev, struct asus_wmi, kbd_led);
scoped_guard(spinlock_irqsave, &asus_ref.lock)
- asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
+ asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
if (asus->kbd_led_avail)
kbd_led_update(asus);
@@ -2164,7 +2164,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
asus->kbd_led.brightness_set_blocking = kbd_led_set;
asus->kbd_led.brightness_get = kbd_led_get;
- asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
+ asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
+ 1 : ASUS_EV_MAX_BRIGHTNESS;
asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
@@ -4706,7 +4707,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
return;
}
if (code == NOTIFY_KBD_BRTTOGGLE) {
- if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
+ if (led_value >= asus->kbd_led.max_brightness)
kbd_led_set_by_kbd(asus, 0);
else
kbd_led_set_by_kbd(asus, led_value + 1);
diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
index b45f81b38..74e30a2d7 100644
--- a/drivers/platform/asus/asus-wmi.h
+++ b/drivers/platform/asus/asus-wmi.h
@@ -41,6 +41,7 @@ struct quirk_entry {
bool wmi_force_als_set;
bool wmi_ignore_fan;
bool filter_i8042_e1_extended_codes;
+ bool kbd_led_on_off;
int key_wlan_event;
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
int wapf;
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v3] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight
2026-11-22 17:18 ` [PATCH v3] " Martin Szathmari
@ 2026-11-22 17:21 ` Denis Benato
0 siblings, 0 replies; 6+ messages in thread
From: Denis Benato @ 2026-11-22 17:21 UTC (permalink / raw)
To: Martin Szathmari, Corentin Chary, Luke D . Jones
Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86
On 11/22/26 18:18, Martin Szathmari wrote:
> asus-wmi always registers asus::kbd_backlight with max_brightness = 3
> (ASUS_EV_MAX_BRIGHTNESS). On the ASUS ExpertBook B7402FEA the keyboard
> backlight only supports two states: levels 1, 2 and 3 all produce the
> same, full brightness. Userspace therefore shows a 4-step control where
> the top three steps are identical, and the backlight hotkey cycles
> through steps that visibly do nothing.
>
> This matches the vendor-supplied review unit tested by Notebookcheck,
> which describes the B7402FEA as having "single-level key illumination".
>
> Add a kbd_led_on_off quirk which registers the LED with
> max_brightness = 1, and use the LED's max_brightness instead of
> ASUS_EV_MAX_BRIGHTNESS when clamping and when wrapping around on the
> toggle hotkey. Also clamp the level read back from firmware to the LED's
> max_brightness. Enable the quirk for the B7402FEA via an exact DMI board
> name match, keeping the default wmi_backlight_set_devstate behaviour.
>
> On models without the quirk the clamp is to 3, so it only has an
> effect if firmware reports an out-of-range level.
>
> I tested this personally on my own ASUS ExpertBook B7402FEA (BIOS WMI
> version 9.0) with the change backported to v7.3.4: max_brightness reads
> 1, writing 1/0 turns the backlight fully on/off, the Fn backlight hotkey
> toggles on/off, and KDE Plasma's keyboard brightness control shows
> 0%/100%.
Perhaps this should also contain a Fixes tag as the original commit doesn't
consider some hardware like yours but I will defer this decision to Ilpo.
As far as I'm concerned:
Reviewed-by: Denis Benato <denis.benato@linux.dev>
> Link: https://www.notebookcheck.net/Asus-ExpertBook-B7-Flip-in-review-2-in-1-laptop-with-5G-modem-and-long-battery-life.600053.0.html
> Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
> ---
> Changes in v3:
> - Clamp the level read back in kbd_led_read() to max_brightness
> unconditionally instead of only for quirked models (Denis Benato)
> - Re-tested on the B7402FEA
>
> v2: https://lore.kernel.org/platform-driver-x86/20261122164034.7175-1-martin.szathmari@gmail.com/
>
> Changes in v2:
> - Use a ternary for the quirked clamp in kbd_led_read() (Denis Benato)
> - Drop the comment on the new quirk_entry field (Denis Benato)
> - Re-tested on the B7402FEA
>
> v1: https://lore.kernel.org/platform-driver-x86/20261122144147.7916-1-martin.szathmari@gmail.com/
>
> Based on pdx86 for-next; happy to rebase if other keyboard lighting
> changes need to go in first.
>
> Note: This patch was developed with the help of an AI coding assistant
> (Claude Opus 5.5). I reviewed the change and tested it myself on my
> ASUS ExpertBook B7402FEA as described above.
>
> drivers/platform/asus/asus-nb-wmi.c | 14 ++++++++++++++
> drivers/platform/asus/asus-wmi.c | 13 +++++++------
> drivers/platform/asus/asus-wmi.h | 1 +
> 3 files changed, 22 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
> index 3b0f3346d..9204213be 100644
> --- a/drivers/platform/asus/asus-nb-wmi.c
> +++ b/drivers/platform/asus/asus-nb-wmi.c
> @@ -154,6 +154,11 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
> .key_wlan_event = ASUS_WMI_KEY_IGNORE,
> };
>
> +static struct quirk_entry quirk_asus_kbd_led_on_off = {
> + .wmi_backlight_set_devstate = true,
> + .kbd_led_on_off = true,
> +};
> +
> static struct quirk_entry quirk_asus_z13 = {
> .key_wlan_event = ASUS_WMI_KEY_ARMOURY,
> .tablet_switch_mode = asus_wmi_kbd_dock_devid,
> @@ -585,6 +590,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = &quirk_asus_proart_px13,
> },
> + {
> + .callback = dmi_matched,
> + .ident = "ASUS ExpertBook B7402FEA",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "B7402FEA"),
> + },
> + .driver_data = &quirk_asus_kbd_led_on_off,
> + },
> {},
> };
>
> diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
> index b33ebdb21..f99512d29 100644
> --- a/drivers/platform/asus/asus-wmi.c
> +++ b/drivers/platform/asus/asus-wmi.c
> @@ -1837,14 +1837,14 @@ int asus_hid_event(enum asus_hid_event event)
> brightness -= 1;
> break;
> case ASUS_EV_BRTTOGGLE:
> - if (brightness >= ASUS_EV_MAX_BRIGHTNESS)
> + if (brightness >= asus->kbd_led.max_brightness)
> brightness = 0;
> else
> brightness += 1;
> break;
> }
>
> - asus->kbd_led_wk = clamp_val(brightness, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(brightness, 0, asus->kbd_led.max_brightness);
> asus->kbd_led_notify = true;
> queue_work(asus->led_workqueue, &asus->kbd_led_work);
> return 0;
> @@ -1923,7 +1923,7 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
> return retval;
>
> if (level)
> - *level = retval & 0x7F;
> + *level = min(retval & 0x7F, asus->kbd_led.max_brightness);
> if (env)
> *env = (retval >> 8) & 0x7F;
> return 0;
> @@ -1937,7 +1937,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
> asus = container_of(led_cdev, struct asus_wmi, kbd_led);
>
> scoped_guard(spinlock_irqsave, &asus_ref.lock)
> - asus->kbd_led_wk = clamp_val(value, 0, ASUS_EV_MAX_BRIGHTNESS);
> + asus->kbd_led_wk = clamp_val(value, 0, led_cdev->max_brightness);
>
> if (asus->kbd_led_avail)
> kbd_led_update(asus);
> @@ -2164,7 +2164,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
> asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
> asus->kbd_led.brightness_set_blocking = kbd_led_set;
> asus->kbd_led.brightness_get = kbd_led_get;
> - asus->kbd_led.max_brightness = ASUS_EV_MAX_BRIGHTNESS;
> + asus->kbd_led.max_brightness = asus->driver->quirks->kbd_led_on_off ?
> + 1 : ASUS_EV_MAX_BRIGHTNESS;
> asus->kbd_led_avail = !kbd_led_read(asus, &led_val, NULL);
> INIT_WORK(&asus->kbd_led_work, kbd_led_update_all);
>
> @@ -4706,7 +4707,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
> return;
> }
> if (code == NOTIFY_KBD_BRTTOGGLE) {
> - if (led_value >= ASUS_EV_MAX_BRIGHTNESS)
> + if (led_value >= asus->kbd_led.max_brightness)
> kbd_led_set_by_kbd(asus, 0);
> else
> kbd_led_set_by_kbd(asus, led_value + 1);
> diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
> index b45f81b38..74e30a2d7 100644
> --- a/drivers/platform/asus/asus-wmi.h
> +++ b/drivers/platform/asus/asus-wmi.h
> @@ -41,6 +41,7 @@ struct quirk_entry {
> bool wmi_force_als_set;
> bool wmi_ignore_fan;
> bool filter_i8042_e1_extended_codes;
> + bool kbd_led_on_off;
> int key_wlan_event;
> enum asus_wmi_tablet_switch_mode tablet_switch_mode;
> int wapf;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-22 17:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 14:41 [PATCH] platform/asus: asus-wmi: Add quirk for on/off-only keyboard backlight Martin Szathmari
2026-11-22 15:01 ` Denis Benato
2026-11-22 16:40 ` [PATCH v2] " Martin Szathmari
2026-11-22 16:56 ` Denis Benato
2026-11-22 17:18 ` [PATCH v3] " Martin Szathmari
2026-11-22 17:21 ` Denis Benato
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.