Re: lenovo-ymc: Yoga 7 14IRL8 keyboard backlight stays on in tablet mode; EC expects VPC 0x2A with posture data

From: Rong Zhang

Date: Thu Oct 29 2026 - 13:19:23 EST


Hi Mahir,

Thanks for the report.

On Thu, 2026-10-29 at 03:21 +0600, Mahir Faisal wrote:
> Hello,
>
> On a Lenovo Yoga 7 14IRL8 the keyboard backlight stays on when the
> laptop is folded into tablet/tent/stand mode under Linux, while on
> Windows it turns off. I traced the difference to a VPC command that
> the Windows YMC service sends on every posture change and that Linux
> does not send. Details below; I'd appreciate your view on whether
> lenovo-ymc/ideapad-laptop should send it.
>
> System
> ------
> Model: Lenovo Yoga 7 14IRL8 (DMI product name: 82YL)
> BIOS: LHCN30WW (latest)
> Kernel: 7.2.11-300.fc45.x86_64 (Fedora)
>
> Symptom
> -------
> When folded, the EC disables the keyboard (no input reaches a VT) and
> SW_TABLET_MODE is reported correctly by lenovo-ymc. The keyboard
> backlight, however, stays at its previous level. Writes through
> KBLC (via the ideapad-laptop kbd_backlight LED / UPower) are stored in
> the EC (KBLS reads back the new value) but are not applied while
> folded, so there is no way to turn the backlight off without
> unfolding.
>
> The BIOS changelog suggests this is meant to be EC-driven. LHCN10WW,
> "EC Notification":
> "Fix the issue of keyboard backlight is on when turn on in notebook
> mode and change NoteBook mode to Yoga mode."
>
> The DSDT contains no tablet-mode handling in KBLC, and _Q1B only does
> Notify (WMIY, 0xD0). WMIY.WMAB just returns PCMD.
>
> What Windows does
> -----------------
> The "Lenovo Yoga Mode Control" package (YMC.exe 3.0.1.5, bound to
> ACPI\YMC2017) sends IOCTL 0x831020C0 to \\.\EnergyDrv with a 12-byte
> buffer {0x0C, 1, X}. EnergyDrv is AcpiVpc.sys from "Lenovo Energy
> Management". Its handler for that IOCTL maps function 0x0C to VPC
> command 0x2A (VPCCMD_W_YMC) and issues it through VPCW with X as the
> data byte, using the same VDAT/VCMD sequence as write_ec_cmd().
>
> Values of X observed in YMC.exe:
> 0x0A service start
> 0x08 posture != laptop (tent/stand/tablet)
> 0x09 posture == laptop
> 0x0B service stop

What if:

- 0x0A is not sent on start
- 0x08/0x09 is sent after sending 0x0B
- 0x0A/0x08/0x09/0x0B is repeatedly sent multiple times

>
> Current Linux behaviour
> -----------------------
> ideapad_laptop_trigger_ec() sends VPCCMD_W_YMC with data 1, and only
> for models in ymc_ec_trigger_quirk_dmi_table. Booting with
> ideapad_laptop.ymc_ec_trigger=1 on this machine has no effect on the
> backlight.
>
> Test
> ----
> Using acpi_call against \_SB.PC00.LPCB.H_EC.VPC0, with VPCW 0 <data>
> followed by VPCW 1 0x2a, then polling VPCR 1 until 0:
>
> data 0x0A, then fold -> no change, backlight stays on
> fold, then data 0x08 -> EC turns the keyboard backlight off
> unfold, then data 0x09 -> keyboard and backlight work normally

What if 0x0B is sent when the keyboard backlight is on?

>
> I'm currently running a small userspace daemon that sends 0x0A at
> start, then 0x08/0x09 on each SW_TABLET_MODE change. It has worked
> reliably so far.

What if:
- 0x08 is sent when unfolded
- 0x09 is sent when folded

>
> Suggestion
> ----------
> On a YMC event, send VPCCMD_W_YMC with 0x08 when the reported posture
> is anything other than laptop and 0x09 for laptop, instead of 1. This
> might also be worth doing outside the quirk table, since it matches
> what the Windows driver does on every model it supports. I can't tell
> whether data 1 is still needed on the models already in the quirk
> table (Yoga 7 14ARB7 / 14ACN6) for event re-arming, so someone with
> that hardware would need to check.

There is a chance that the 0x0A[start] => (0x08[fold] <=> 0x09[unfold])
=> 0x0B[stop] sequence is generic. Derek, Mark, could you confirm if the
sequence exists in the documentation? If so, I think we can replace the
quirk table and the module parameter with the standard sequence. I will
prepare a patch once I get enough information.

+CC Gergo, Andrew, André, Swapnil

I believe the quirk was concluded by trial and error. Could you test if
the above sequence works on your devices?

>
> I can provide an acpidump, the disassembly excerpts, or test patches
> on this machine.

An acpidump would be helpful.

Thanks,
Rong

>
> Disclosure: AI assistance was used to troubleshoot the issue and draft
> this email.
>
> Thanks,
> Mahir