Re: [PATCH v2 6/7] platform/x86: ideapad-laptop: Trigger the EC on YMC events following Windows behavior
From: Rong Zhang
Date: Wed Nov 25 2026 - 06:31:39 EST
Hi Gergo,
Thanks for testing.
On Wed, 2026-11-25 at 11:56 +0100, Gergo Koteles wrote:
> Hi Rong,
>
> Thank you for taking care of this.
>
> On Wed, 2026-11-25 at 02:17 +0800, Rong Zhang wrote:
> > Currently, the ideapad-laptop driver triggers the EC with YMC command
> > 0x01, which seems to be randomly chosen with trial-and-error and turns
> > out to be not a command for YMC events. While the devices in the DMI
> > quirk table recognize it, some other devices do not, making the
> > trigger_ec functionality a no-op.
> >
> > Lenovo's YMC driver for Windows (YMC.exe) emits YMC command 0x08/0x09 on
> > fold/unfold YMC events, in which "unfold" means laptop mode and "fold"
> > means other modes.
> >
> > Adopt the said sequence to make it work on all relevant devices. For the
> > sake of caution, only emit YMC command 0x08 only for the known fold
> > postures. For all other postures (including unknown ones), emit 0x09 to
> > make sure the touchpad and keyboard are still functional.
> >
> > Reported-by: Mahir Faisal <mahirfaisalantiq33@xxxxxxxxx>
> > Closes: https://msgid.link/CAGAHqH6o0TUa1HXMrNV6e+HNYwU3xxHkOM665756n8Cp3AzhVQ@xxxxxxxxxxxxxx
> > Reviewed-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
> > Signed-off-by: Rong Zhang <i@xxxxxxxx>
> > ---
> > Changes in v2:
> > - Fix typos (thanks Mark Pearson)
> > ---
> >
>
> ...
>
> > scoped_guard(mutex, &priv->vpc_mutex)
> > - ret = write_ec_cmd(priv->adev->handle, VPCCMD_W_YMC, 1);
> > + ret = write_ec_cmd(priv->adev->handle, VPCCMD_W_YMC, cmd);
>
> Unfortunately, the 14ARB7 does not emit a SW_TABLET_MODE after
> triggering the ec with 8/9 or the fixed value of 8 or 9. It only works
> with 1.
Did you mean triggering the EC with 8/9 acts like a kill-switch on your
device that blocks any *further* LENOVO_YMC_EVENTs? Can triggering the EC
with 1 again makes it recover?
>
> However, it turns off the keyboard and touchpad when triggered by 8/9
> or 1, as well as without any trigger.
So it seems that any YMC commands can synchronize the state of the
keyboard and touchpad, but only 1 can actually "consume" the event.
>
> Perhaps the triggering should be handled on a per-model basis?
I don't want to add too many complexities to the DMI quirk table and the
module parameter.
Considering that triggering the EC with 1 does nothing on newer models,
perhaps we can trigger the EC with 8,1/9,1 as long as the trailing 1
recovers the event delivery.
Thanks,
Rong
>
> Best regards,
> Gergo