Re: [PATCH v4 10/12] platform/x86: ideapad-laptop: Decouple hardware & classdev brightness for keyboard backlight
[email protected] Sun, 02 Aug 2026 17:31:52 +0000
| Newsgroups | org.kernel.vger.linux-leds |
|---|---|
| Message-ID | <[email protected]> |
> Some recent models come with an ambient light sensor (ALS). On these > models, their EC will automatically set the keyboard backlight to an > appropriate brightness when the effective "hardware brightness" is 3. > "Hardware brightness" can't be perfectly mapped to an LED classdev > brightness, but the EC does use this predefined brightness value to > represent auto mode. >=20 > Currently, the code processing keyboard backlight is coupled with LED > classdev, making it hard to expose the auto brightness (ALS) mode to the > userspace. >=20 > As the first step toward the goal, decouple hardware brightness from LED > classdev brightness, and update comments about corresponding backlight > modes. >=20 > Since upcoming changes will heavily rely on kbd_bl.last_hw_brightness, > also convert it into an atomic_t to prevent potential race conditions. >=20 > To minimalize the diff set in upcoming changes, a trivial refactor > also converts the initialization path into another equivalent form. >=20 > Signed-off-by: Rong Zhang <[email protected]> Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260802-leds-trigg= [email protected]?part=3D10