Re: [PATCH v2 6/7] platform/x86: ideapad-laptop: Trigger the EC on YMC events following Windows behavior
From: Gergo Koteles
Date: Wed Nov 25 2026 - 05:56:42 EST
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.
However, it turns off the keyboard and touchpad when triggered by 8/9
or 1, as well as without any trigger.
Perhaps the triggering should be handled on a per-model basis?
Best regards,
Gergo