[PATCH v3 4/7] platform/x86: thinkpad_acpi: Detect auto-mode capability via MLCG
From: Qiling Zhu
Date: Sat Nov 14 2026 - 12:57:10 EST
The upper bits of the MLCG return value carry capability information.
Bit 20 indicates whether the EC supports the auto mode of the keyboard
backlight (0 = manual levels only, 1 = auto mode available), as defined
by the firmware.
Record it in tp_features.kbdlight_auto, in preparation for using it to
gate the auto-mode trigger registration and the LED suspend/resume
skipping in subsequent changes.
Link: https://lore.kernel.org/r/CABxCQKuEP5wMSstO0MK1MhaqXTKrPhUSN3V2mrE_42j4cXsXZQ@xxxxxxxxxxxxxx
Signed-off-by: Qiling Zhu <kmatzkaczor244@xxxxxxxxx>
---
drivers/platform/x86/lenovo/thinkpad_acpi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index 657a19d11..681b340a1 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -363,6 +363,7 @@ static struct {
TP_HOTKEY_TABLET_USES_GMMS,
} hotkey_tablet;
u32 kbdlight:1;
+ u32 kbdlight_auto:1;
u32 light:1;
u32 light_status:1;
u32 bright_acpimode:1;
@@ -5161,6 +5162,13 @@ static bool kbdlight_is_supported(void)
}
vdbg_printk(TPACPI_DBG_INIT, "kbdlight MLCG returned 0x%x\n", status);
+
+ /*
+ * MLCG bit 20 indicates auto mode support: 0 = manual levels only,
+ * 1 = auto mode available (per the firmware definition).
+ */
+ tp_features.kbdlight_auto = !!(status & BIT(20));
+
/*
* Guessed test for keyboard backlight:
*
--
2.56.1