Re: [PATCH v3 5/7] platform/x86: thinkpad_acpi: Skip LED suspend/resume on auto-mode machines
From: Mark Pearson
Date: Sun Nov 15 2026 - 17:08:40 EST
On Sat, Nov 14, 2026, at 12:48 PM, Qiling Zhu wrote:
> On machines whose EC supports the auto mode (MLCG bit 20) the firmware
> takes care of the keyboard backlight across suspend by itself: on a
> ThinkPad X1 Carbon Gen 14 it turns the backlight off on suspend and
> restores the previous level on resume for the manual levels, and keeps
> auto mode across suspend; after hibernation from auto mode the
> backlight comes back off.
>
> Skip led_classdev_suspend() and led_classdev_resume() entirely on those
> machines: the LED core no longer enters the suspended state, which also
> removes the window in which userspace writes and pending
> set_brightness work would race against a suspended LED.
>
> Machines without auto-mode support keep the existing behavior.
>
> Signed-off-by: Qiling Zhu <kmatzkaczor244@xxxxxxxxx>
> ---
> drivers/platform/x86/lenovo/thinkpad_acpi.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index 681b340a1..f9e2d324d 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -5317,6 +5317,14 @@ static void kbdlight_suspend(void)
> if (!tp_features.kbdlight)
> return;
>
> + /*
> + * On machines with auto-mode support the firmware takes care of
> + * the keyboard backlight across suspend by itself; keep the LED
> + * core out of it.
> + */
> + if (tp_features.kbdlight_auto)
> + return;
> +
> led_cdev = &tpacpi_led_kbdlight.led_classdev;
> led_update_brightness(led_cdev);
> led_classdev_suspend(led_cdev);
> @@ -5327,6 +5335,9 @@ static void kbdlight_resume(void)
> if (!tp_features.kbdlight)
> return;
>
> + if (tp_features.kbdlight_auto)
> + return;
> +
> led_classdev_resume(&tpacpi_led_kbdlight.led_classdev);
> }
>
> --
> 2.56.1
Looks good to me.
Reviewed-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
Mark