Skip to content

Commit e3271a5

Browse files
committed
platform/x86: ideapad-laptop: Stop sending KEY_TOUCHPAD_TOGGLE
Commit 5829f8a ("platform/x86: ideapad-laptop: Send KEY_TOUCHPAD_TOGGLE on some models") made ideapad-laptop send KEY_TOUCHPAD_TOGGLE when we receive an ACPI notify with VPC event bit 5 set and the touchpad-state has not been changed by the EC itself already. This was done under the assumption that this would be good to do to make the touchpad-toggle hotkey work on newer models where the EC does not toggle the touchpad on/off itself (because it is not routed through the PS/2 controller, but uses I2C). But it turns out that at least some models, e.g. the Yoga 7-15ITL5 the EC triggers an ACPI notify with VPC event bit 5 set on resume, which would now cause a spurious KEY_TOUCHPAD_TOGGLE on resume to which the desktop environment responds by disabling the touchpad in software, breaking the touchpad (until manually re-enabled) on resume. It was never confirmed that sending KEY_TOUCHPAD_TOGGLE actually improves things on new models and at least some new models like the Yoga 7-15ITL5 don't have a touchpad on/off toggle hotkey at all, while still sending ACPI notify events with VPC event bit 5 set. So it seems best to revert the change to send KEY_TOUCHPAD_TOGGLE when receiving an ACPI notify events with VPC event bit 5 and the touchpad state as reported by the EC has not changed. Note this is not a full revert the code to cache the last EC touchpad state is kept to avoid sending spurious KEY_TOUCHPAD_ON / _OFF events on resume. Fixes: 5829f8a ("platform/x86: ideapad-laptop: Send KEY_TOUCHPAD_TOGGLE on some models") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217234 Cc: [email protected] Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e352d68 commit e3271a5

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

drivers/platform/x86/ideapad-laptop.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ static const struct key_entry ideapad_keymap[] = {
11701170
{ KE_KEY, 65, { KEY_PROG4 } },
11711171
{ KE_KEY, 66, { KEY_TOUCHPAD_OFF } },
11721172
{ KE_KEY, 67, { KEY_TOUCHPAD_ON } },
1173-
{ KE_KEY, 68, { KEY_TOUCHPAD_TOGGLE } },
11741173
{ KE_KEY, 128, { KEY_ESC } },
11751174

11761175
/*
@@ -1526,18 +1525,16 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv, bool send_
15261525
if (priv->features.ctrl_ps2_aux_port)
15271526
i8042_command(&param, value ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE);
15281527

1529-
if (send_events) {
1530-
/*
1531-
* On older models the EC controls the touchpad and toggles it
1532-
* on/off itself, in this case we report KEY_TOUCHPAD_ON/_OFF.
1533-
* If the EC did not toggle, report KEY_TOUCHPAD_TOGGLE.
1534-
*/
1535-
if (value != priv->r_touchpad_val) {
1536-
ideapad_input_report(priv, value ? 67 : 66);
1537-
sysfs_notify(&priv->platform_device->dev.kobj, NULL, "touchpad");
1538-
} else {
1539-
ideapad_input_report(priv, 68);
1540-
}
1528+
/*
1529+
* On older models the EC controls the touchpad and toggles it on/off
1530+
* itself, in this case we report KEY_TOUCHPAD_ON/_OFF. Some models do
1531+
* an acpi-notify with VPC bit 5 set on resume, so this function get
1532+
* called with send_events=true on every resume. Therefor if the EC did
1533+
* not toggle, do nothing to avoid sending spurious KEY_TOUCHPAD_TOGGLE.
1534+
*/
1535+
if (send_events && value != priv->r_touchpad_val) {
1536+
ideapad_input_report(priv, value ? 67 : 66);
1537+
sysfs_notify(&priv->platform_device->dev.kobj, NULL, "touchpad");
15411538
}
15421539

15431540
priv->r_touchpad_val = value;

0 commit comments

Comments
 (0)