mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rong Zhang <i@rong.moe>
To: "Gergo Koteles" <soyer@irl.hu>,
	"Mark Pearson" <mpearson-lenovo@squebb.ca>,
	"Derek J. Clark" <derekjohn.clark@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Ike Panhc" <ikepanhc@gmail.com>,
	"Andrew Kallmeyer" <kallmeyeras@gmail.com>
Cc: Eduard Aliman <edialiman20@gmail.com>,
	 platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Mahir Faisal	 <mahirfaisalantiq33@gmail.com>
Subject: Re: [PATCH v2 6/7] platform/x86: ideapad-laptop: Trigger the EC on YMC events following Windows behavior
Date: Wed, 25 Nov 2026 19:26:02 +0800	[thread overview]
Message-ID: <7bf18131ce00d8aeab1e01721dc0cd71972ea365.camel@rong.moe> (raw)
In-Reply-To: <84a3d94cc78ba0a26ed7b0af7cfcbde65433aa1e.camel@irl.hu>

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@gmail.com>
> > Closes: https://msgid.link/CAGAHqH6o0TUa1HXMrNV6e+HNYwU3xxHkOM665756n8Cp3AzhVQ@mail.gmail.com
> > Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> > Signed-off-by: Rong Zhang <i@rong.moe>
> > ---
> > 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

  reply	other threads:[~2026-11-25 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 18:16 [PATCH v2 0/7] " Rong Zhang
2026-11-24 18:16 ` [PATCH v2 1/7] platform/x86: lenovo-ymc: Use enumeration to represent device posture Rong Zhang
2026-11-24 18:16 ` [PATCH v2 2/7] platform/x86: lenovo-ymc: Serialize WMI event handling Rong Zhang
2026-11-24 18:16 ` [PATCH v2 3/7] platform/x86: lenovo-wmi-events: Modernize " Rong Zhang
2026-11-24 18:17 ` [PATCH v2 4/7] platform/x86: lenovo-ymc: Modernize WMI driver and factor out events Rong Zhang
2026-11-24 18:17 ` [PATCH v2 5/7] platform/x86: lenovo-ymc: Refresh posture on resume Rong Zhang
2026-11-24 18:17 ` [PATCH v2 6/7] platform/x86: ideapad-laptop: Trigger the EC on YMC events following Windows behavior Rong Zhang
2026-11-25 10:56   ` Gergo Koteles
2026-11-25 11:26     ` Rong Zhang [this message]
2026-11-25 11:46       ` Gergo Koteles
2026-11-24 18:17 ` [PATCH v2 7/7] platform/x86: ideapad-laptop: Enable ymc_ec_trigger for Lenovo Yoga 7 14IRL8 Rong Zhang
2026-11-25  8:24 ` [PATCH v2 0/7] platform/x86: ideapad-laptop: Trigger the EC on YMC events following Windows behavior Eduard Aliman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bf18131ce00d8aeab1e01721dc0cd71972ea365.camel@rong.moe \
    --to=i@rong.moe \
    --cc=derekjohn.clark@gmail.com \
    --cc=edialiman20@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ikepanhc@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kallmeyeras@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahirfaisalantiq33@gmail.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=soyer@irl.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®