Skip to content

fix: Y-Logo LED GET/SET byte mismatch and IO-Port init on Gen 10#402

Open
alstergee wants to merge 1 commit intojohnfanv2:mainfrom
alstergee:fix/ylogo-led-gen10
Open

fix: Y-Logo LED GET/SET byte mismatch and IO-Port init on Gen 10#402
alstergee wants to merge 1 commit intojohnfanv2:mainfrom
alstergee:fix/ylogo-led-gen10

Conversation

@alstergee
Copy link
Copy Markdown

@alstergee alstergee commented Feb 27, 2026

Summary

  • Y-Logo LED GET: DSDT puts on/off state in result[0] (LCST) for LIGHT_ID_YLOGO, but driver reads result[1] (LCBL) which is hardcoded to 0. Fixed by reading result[0] when light_id == LIGHT_ID_YLOGO.
  • Y-Logo LED SET: DSDT checks byte 1 (SCST) for Y-Logo on/off control, but driver hardcodes byte[1] = 0x01 and puts the brightness in byte[2] (SCBL). Fixed by placing the on/off value in byte 1 with EC convention (1=ON, 2=OFF).
  • IO-Port LED init: On BIOS Q7CN45WW, DSDT WMAF doesn't handle LIGHT_ID_IOPORT (0x05) — GET returns 0 from the default GLCS buffer. The lower_limit=1 validation rejects 0, failing init. Changed to lower_limit=0.

DSDT Analysis (Q7CN45WW)

The WMAF method handles light IDs differently:

Light ID GET return byte SET control byte EC encoding
0x00 (Keyboard) result[1] (LCBL) byte 2 (SCBL) 1/2/3 = brightness levels
0x03 (Y-Logo) result[0] (LCST) byte 1 (SCST) 1=ON, 2=OFF
0x05 (IO-Port) Not handled (returns 0) Not handled N/A

The driver previously treated all light IDs the same as the keyboard backlight.

Hardware note

On Spectrum-equipped Gen 10 models (like the 16IAX10H / 83F5), the physical lid logo LED is controlled by the ITE 8258 USB HID controller (048d:c197) via the Spectrum protocol (OP_LOGO_STATUS), not the WMI/ACPI path. The WMI Y-Logo interface may only be relevant for non-Spectrum models.

Test plan

  • Tested on Lenovo Legion Pro 7 16IAX10H (83F5), BIOS Q7CN45WW
  • echo 1 > /sys/class/leds/platform::ylogo/brightness — writes without error, reads back 1
  • echo 0 > /sys/class/leds/platform::ylogo/brightness — writes without error, reads back 0
  • IO-Port LED init no longer fails (no "expected brightness 1-2, got 0" in dmesg)
  • Keyboard backlight unaffected (still uses existing byte 2 path)
  • Needs testing on non-Spectrum models to verify Y-Logo WMI physically toggles the LED

The DSDT WMAF method uses different byte positions for the Y-Logo LED
(LIGHT_ID_YLOGO = 0x03) compared to the keyboard backlight:

Y-Logo GET: state is in result[0] (LCST), result[1] (LCBL) is always 0
Y-Logo SET: DSDT checks byte 1 (SCST) for on/off, ignores byte 2 (SCBL)
            EC convention: SCST=1 means ON, SCST=2 means OFF

The driver previously treated all lights the same as the keyboard
backlight (value in byte 2, read from byte 1), causing Y-Logo GET
to always return 0 and SET to always send SCST=1 (always ON).

Also fixes IO-Port LED (LIGHT_ID_IOPORT = 0x05) init failure on
BIOS Q7CN45WW where DSDT returns 0 for unhandled light IDs.
Changed lower_limit from 1 to 0 so the validation check passes.

Tested on Lenovo Legion Pro 7 16IAX10H (83F5) with BIOS Q7CN45WW.

Note: On Spectrum-equipped Gen 10 models, the physical lid logo LED
is actually controlled by the ITE 8258 USB HID controller (048d:c197),
not the WMI/ACPI path. The Y-Logo WMI interface may only be relevant
for non-Spectrum models. The IO-Port LED WMI interface (SLID=5) is
not handled by the DSDT WMAF method at all on this model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChaoticSi1ence added a commit to ChaoticSi1ence/legion-pro-7-16iax10h-linux that referenced this pull request Mar 1, 2026
DSDT uses different byte positions for Y-Logo (LIGHT_ID_YLOGO = 0x03)
vs keyboard backlight:
  GET: Y-Logo state is in result[0] (LCST), not result[1] (LCBL)
  SET: DSDT checks byte 1 (SCST) for on/off, EC convention 1=ON 2=OFF

The driver treated all lights like keyboard backlight (value in byte 2,
read from byte 1), causing Y-Logo GET to always return 0 and SET to
never actually turn it off.

Based on alstergee's DSDT analysis from upstream PR johnfanv2#402.
IO-Port lower_limit fix was already applied in 62ffe9c.
@ChaoticSi1ence
Copy link
Copy Markdown

Thanks for the thorough DSDT analysis and clean fix, @alstergee. The Y-Logo GET/SET byte mismatch is a real bug — the driver was treating all light IDs like the keyboard backlight.

I've picked up your Y-Logo fixes in my fork (ChaoticSi1ence/LenovoLegionLinux@3788257). The IO-Port lower_limit fix was already there from an earlier commit.

Nice catch on the Spectrum vs WMI distinction for the lid LED too — good to have that documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants