[PATCH 0/2] platform/x86: ideapad-laptop: Fully support auto kbd backlight

Rong Zhang posted 2 patches 2 months ago
.../ABI/testing/sysfs-platform-ideapad-laptop |  12 ++
drivers/platform/x86/lenovo/ideapad-laptop.c  | 186 ++++++++++++++----
2 files changed, 163 insertions(+), 35 deletions(-)
[PATCH 0/2] platform/x86: ideapad-laptop: Fully support auto kbd backlight
Posted by Rong Zhang 2 months ago
Hi all,

Some recent models supported by ideapad-laptop 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 "HW
brightness" is 3. The term "HW brightness" means that it cannot be
perfectly mapped to an LED classdev brightness, but the EC does use this
predefined brightness value to represent such a mode.

Currently, the auto brightness mode of keyboard backlight maps to
brightness=0 in LED classdev. The only method to switch to this mode is
by pressing the manufacturer-defined shortcut (Fn+Space). However, 0 is
a multiplexed brightness value; writing 0 simply results in the
backlight being turned off.

Fully support this mode by adding a sysfs node:
/sys/class/leds/platform::kbd_backlight/als_enabled. The name is chosen
to align with dell-laptop, which provides a similar feature.

Thanks,
Rong

Rong Zhang (2):
  platform/x86: ideapad-laptop: Decouple HW & cdev brightness for kbd
    backlight
  platform/x86: ideapad-laptop: Fully support auto kbd backlight

 .../ABI/testing/sysfs-platform-ideapad-laptop |  12 ++
 drivers/platform/x86/lenovo/ideapad-laptop.c  | 186 ++++++++++++++----
 2 files changed, 163 insertions(+), 35 deletions(-)


base-commit: 7e161a991ea71e6ec526abc8f40c6852ebe3d946
-- 
2.50.1