platform/x86: ideapad-laptop: Only toggle ps2 aux port on/off on select models
authorHans de Goede <hdegoede@redhat.com>
Thu, 17 Nov 2022 11:02:41 +0000 (12:02 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 21 Nov 2022 10:12:18 +0000 (11:12 +0100)
commitc69e7d843d2c34b80b8731a5dc57c34ea04a3edf
tree5c94904bf204121ba224c9dd3091c3dfb4e2949a
parentf4dd8c44bb831ff885680bc77111fa39c193a93f
platform/x86: ideapad-laptop: Only toggle ps2 aux port on/off on select models

Recently there have been multiple patches to disable the ideapad-laptop's
touchpad control code, because it is causing issues on various laptops:

Commit d69cd7eea93e ("platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634")
Commit a231224a601c ("platform/x86: ideapad-laptop: Disable touchpad_switch")

The turning on/off of the ps2 aux port was added specifically for
the IdeaPad Z570, where the EC does toggle the touchpad on/off LED and
toggles the value returned by reading VPCCMD_R_TOUCHPAD, but it does not
actually turn on/off the touchpad.

The ideapad-laptop code really should not be messing with the i8042
controller on all devices just for this special case.

Add a new ctrl_ps2_aux_port flag set based on a DMI based allow-list
for devices which need this workaround, populating it with just
the Ideapad Z570 for now.

This also adds a module parameter so that this behavior can easily
be enabled on other models which may need it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Link: https://lore.kernel.org/r/20221117110244.67811-4-hdegoede@redhat.com
drivers/platform/x86/ideapad-laptop.c