From: Qiling Zhu <kmatzkaczor244@gmail.com>
To: "Mark Pearson" <mpearson-lenovo@squebb.ca>,
"Derek J. Clark" <derekjohn.clark@gmail.com>,
"Rong Zhang" <i@rong.moe>, "Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>
Cc: Griffin Kroah-Hartman <griffin@kroah.com>,
ibm-acpi-devel@lists.sourceforge.net, Lee Jones <lee@kernel.org>,
linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
Pavel Machek <pavel@kernel.org>,
platform-driver-x86@vger.kernel.org, vishnuocv@gmail.com,
vsankar@lenovo.com, Qiling Zhu <kmatzkaczor244@gmail.com>
Subject: [RFC PATCH 0/1] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight
Date: Sun, 1 Nov 2026 18:01:22 +0800 [thread overview]
Message-ID: <20261101100123.28749-1-kmatzkaczor244@gmail.com> (raw)
Hi Mark, Ilpo, Rong,
Recent ThinkPads with an ambient light sensor (ALS) support an auto
mode for the keyboard backlight: the EC picks the backlight level
according to ambient light. The mode is EC keyboard backlight level 3,
above the two fixed levels exposed so far, and it is reachable only
through the Fn+Space shortcut, which is handled entirely by the
firmware. Userspace can neither select the mode nor observe whether it
is active.
This series wires the auto mode up as a private hardware control
trigger, "tpacpi-kbd-auto", on top of the hw control trigger framework
that recently landed in mainline [1]. With it:
- selecting the trigger writes EC level 3 (auto mode on); writing
"none" turns the backlight off
- the trigger state (bracketed in the trigger sysfs attribute, and
the new trigger_may_offload_to_hw attribute) is the userspace
view of auto mode; reading brightness returns -ENODATA while
auto mode is active, per the framework semantics
- Fn+Space keeps cycling through levels and auto mode as before,
and the trigger state now follows hardware-initiated transitions
automatically
This is the thinkpad_acpi counterpart of the ideapad-laptop wiring
from the same framework series, which is still queued; this patch
depends only on the LED core parts already in mainline and can be
applied independently.
For background: the February discussion settled that auto mode must
not be exposed as a brightness value [2], but no agreement was
reached back then on how to expose it instead; the hardware control
trigger approach was established later by the framework series [1].
Tested on a ThinkPad X1 Carbon Gen 14 (MT 21V8) running linux-next
next-20261030: 61 scripted user-visible assertions covering the
software paths, the Fn+Space event chain and the unchanged legacy
behavior, plus manual exercising of both the Fn+Space cycling and
desktop-environment brightness controls; checkpatch --strict clean.
Deliberately unchanged (details in the commit message):
- max_brightness stays 2; auto mode is not multiplexed into the
brightness value
- writing 3 to /proc/acpi/ibm/kbdlight keeps returning -EINVAL
- module unload still turns the keyboard backlight off
Two open questions, the main reason for the RFC tag:
1. MLCG returns capability bits in the upper 16 bits; does one of
them indicate auto mode support? If yes, I would gate trigger
registration on it. Mark, does the EC documentation say?
2. On models without an ALS, the EC behavior when asked for level 3
via MLCS is unknown to me. If it is undefined rather than
rejected, optimistic registration would need a rethink (e.g.
DMI whitelisting).
Rong, happy to rebase this on top of your series or fold it in, if
you prefer to keep both wirings together.
Comments welcome.
Regards,
Qiling Zhu
This patch was developed with LLM assistance; I reviewed every design
decision against the framework sources and validated the behavior on
real hardware myself.
[1] https://lore.kernel.org/r/20260618-leds-trigger-hw-changed-v2-0-c28c44053cf3@rong.moe/
[2] https://lore.kernel.org/r/20260203232219.11683-1-vishnuocv@gmail.com/
Qiling Zhu (1):
platform/x86: thinkpad_acpi: Add support for auto keyboard backlight
drivers/platform/x86/lenovo/Kconfig | 1 +
drivers/platform/x86/lenovo/thinkpad_acpi.c | 104 ++++++++++++++++----
2 files changed, 88 insertions(+), 17 deletions(-)
--
2.56.0
next reply other threads:[~2026-11-01 10:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 10:01 Qiling Zhu [this message]
2026-11-01 10:01 ` [RFC PATCH 1/1] " Qiling Zhu
2026-11-01 18:24 ` Rong Zhang
2026-11-01 17:57 ` [RFC PATCH 0/1] " Rong Zhang
2026-11-02 15:10 ` [RFC PATCH v2 0/2] " Qiling Zhu
2026-11-02 15:10 ` [RFC PATCH v2 1/2] platform/x86: thinkpad_acpi: Extract kbdlight_notify_change() helper Qiling Zhu
2026-11-02 15:10 ` [RFC PATCH v2 2/2] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight Qiling Zhu
2026-11-02 18:32 ` Rong Zhang
2026-11-02 18:13 ` [RFC PATCH v2 0/2] " Rong Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261101100123.28749-1-kmatzkaczor244@gmail.com \
--to=kmatzkaczor244@gmail.com \
--cc=derekjohn.clark@gmail.com \
--cc=griffin@kroah.com \
--cc=hansg@kernel.org \
--cc=hmh@hmh.eng.br \
--cc=i@rong.moe \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
--cc=pavel@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=vishnuocv@gmail.com \
--cc=vsankar@lenovo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®