From: Hans de Goede <hdegoede@redhat.com>
To: Manyi Li <limanyi@uniontech.com>
Cc: ike.pan@canonical.com, linux-kernel@vger.kernel.org,
markgross@kernel.org, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2] platform/x86: ideapad-laptop: Disable touchpad_switch
Date: Mon, 7 Nov 2022 10:58:36 +0100 [thread overview]
Message-ID: <fdceb6d2-c38c-e8ff-4c19-b01521ca46c0@redhat.com> (raw)
In-Reply-To: <20221018095323.14591-1-limanyi@uniontech.com>
Hi Manyi,
On 10/18/22 11:53, Manyi Li wrote:
> Ideapads for "Lenovo Yoga 3 Pro 1370" and "ZhaoYang K4e-IML" do not
> use EC to switch touchpad.
>
> Reading VPCCMD_R_TOUCHPAD will return zero thus touchpad may be blocked
> unexpectedly.
>
> Signed-off-by: Manyi Li <limanyi@uniontech.com>
I have applied this patch for now, since it should be safe to do so
as the exceptions added are DMI string based.
But I would really like to see a better fix for this, by for example
checking if the touchpad is connected over I2C. Can you run
"acpidump -o acpidump.txt" and then send me a private email with the
generated acpidump.txt ? Please do this for both models if possible.
Also I don't entirely understand why this patch is necessary in
the first place. You say that the touchpad is connected over I2C;
and when priv->features.touchpad_ctrl_via_ec = 1 the following
2 commands are possibly run by the driver:
i8042_command(¶m, value ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE);
if (!priv->features.touchpad_ctrl_via_ec)
write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1);
Note the second command actually gets enabled by this patch setting
priv->features.touchpad_ctrl_via_ec = 0.
What (undesirable) behavior are you seeing without this patch ?
And can you try a kernel without this patch and then comment
out the i8042_command() command and see if that helps ?
If that does not help, can you try removing the "if" part of:
if (!priv->features.touchpad_ctrl_via_ec)
write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1);
So that the write_ec_cmd() happens unconditionally and see if that
helps ?
Regards,
Hans
> ---
> drivers/platform/x86/ideapad-laptop.c | 25 ++++++++++++++++++++++++-
> 1 file changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index abd0c81d62c4..33b3dfdd1b08 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1533,6 +1533,24 @@ static const struct dmi_system_id hw_rfkill_list[] = {
> {}
> };
>
> +static const struct dmi_system_id no_touchpad_switch_list[] = {
> + {
> + .ident = "Lenovo Yoga 3 Pro 1370",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
> + },
> + },
> + {
> + .ident = "ZhaoYang K4e-IML",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"),
> + },
> + },
> + {}
> +};
> +
> static void ideapad_check_features(struct ideapad_private *priv)
> {
> acpi_handle handle = priv->adev->handle;
> @@ -1541,7 +1559,12 @@ static void ideapad_check_features(struct ideapad_private *priv)
> priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
>
> /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
> - priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1);
> + if (acpi_dev_present("ELAN0634", NULL, -1))
> + priv->features.touchpad_ctrl_via_ec = 0;
> + else if (dmi_check_system(no_touchpad_switch_list))
> + priv->features.touchpad_ctrl_via_ec = 0;
> + else
> + priv->features.touchpad_ctrl_via_ec = 1;
>
> if (!read_ec_data(handle, VPCCMD_R_FAN, &val))
> priv->features.fan_mode = true;
next prev parent reply other threads:[~2022-11-07 9:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 6:14 [PATCH] platform/x86: ideapad-laptop: Disable touchpad_switch Manyi Li
2022-10-18 7:48 ` Hans de Goede
2022-10-18 9:53 ` [PATCH v2] " Manyi Li
2022-11-07 9:58 ` Hans de Goede [this message]
2022-10-18 10:09 ` [PATCH] " Manyi Li
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=fdceb6d2-c38c-e8ff-4c19-b01521ca46c0@redhat.com \
--to=hdegoede@redhat.com \
--cc=ike.pan@canonical.com \
--cc=limanyi@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.