summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-11-17 12:02:44 +0100
committerHans de Goede <hdegoede@redhat.com>2022-11-21 11:16:49 +0100
commit301e0d766d7018a579063f539837f0f1fa1b2948 (patch)
treedce129cd07300d5e2f147ced5574a53533d529ec /drivers/platform
parenta10ba160d427e78ffa2ab15a86cacaec291fa58a (diff)
downloadlinux-301e0d766d7018a579063f539837f0f1fa1b2948.tar.bz2
platform/x86: ideapad-laptop: Make touchpad_ctrl_via_ec a module option
Remove the ACPI-HID + DMI-id deny-lists for touchpad_ctrl_via_ec and instead make it a module option which defaults to false. The touchpad sysfs attribute allowing directly writing VPCCMD_W_TOUCHPAD from userspace has been leading to a lot of bug-reports / patches adding both ACPI HID + dmi-id based deny-lists for it which then need to be expanded all the time going forward leading to a high maintenance load. At the same time the touchpad sysfs attribute is not a standard Linux userspace API. So it is not used in standard desktop-enviroments, instead it is only used in the following 2 rare circumstances: 1. Ideapad specific control-panel like applets 2. Custom scripts written by users For 1. these applets need to already deal with the touchpad sysfs attr sometimes not being there because of the existing deny lists so hiding it be default should not cause an issue; and most desktop environments already have a touchpad-disable option in their native control-panel, so having an ideapad specific toggle for this is not necessary. For 2. since these users are already customizing their systems they can add the module option if they want to keep using the touchpad sysfs attribute. 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-7-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/ideapad-laptop.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index fc3d47a75944..435d2d3d903b 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -182,6 +182,12 @@ MODULE_PARM_DESC(ctrl_ps2_aux_port,
"Enable driver based PS/2 aux port en-/dis-abling on touchpad on/off toggle. "
"If you need this please report this to: platform-driver-x86@vger.kernel.org");
+static bool touchpad_ctrl_via_ec;
+module_param(touchpad_ctrl_via_ec, bool, 0444);
+MODULE_PARM_DESC(touchpad_ctrl_via_ec,
+ "Enable registering a 'touchpad' sysfs-attribute which can be used to manually "
+ "tell the EC to enable/disable the touchpad. This may not work on all models.");
+
/*
* shared data
*/
@@ -1654,24 +1660,6 @@ static const struct dmi_system_id ctrl_ps2_aux_port_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;
@@ -1683,14 +1671,7 @@ static void ideapad_check_features(struct ideapad_private *priv)
hw_rfkill_switch || dmi_check_system(hw_rfkill_list);
priv->features.ctrl_ps2_aux_port =
ctrl_ps2_aux_port || dmi_check_system(ctrl_ps2_aux_port_list);
-
- /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
- 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;
+ priv->features.touchpad_ctrl_via_ec = touchpad_ctrl_via_ec;
if (!read_ec_data(handle, VPCCMD_R_FAN, &val))
priv->features.fan_mode = true;