Skip to contentSkip to conversation

HID: lenovo: Fix spurious F23 key press report during resume

PATCH New Hans de Goede 1 participant 2 messages Jul 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover HID: lenovo: Fix spurious F23 key press report during resume

Hi,

Here is one more fix for the Thinkpad 10 Ultrabook Keyboard. This applies on top of the "[PATCH 0/5] HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard support" series which I send out earlier today.

Regards,

Hans

#1 lore raw

PATCH 1/1 HID: lenovo: Fix spurious F23 key press report during resume from suspend

The Ultrabook Keyboard sends a spurious F23 key-press when resuming from suspend. GNOME uses F23 to toggle the touchpad on/off so this causes the OSD graphics for the touchpad toggle to show on resume.

The keyboard does not actually have a F23 key, se we can simple fix it by marking the 0x00070072 HID usage, which normally is F23, to be ignored.

---
 drivers/hid/hid-lenovo.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hid/hid-lenovo.c +7 -0
index b5122ee46801..c6c8e20f3e8d 100644
@@ -245,6 +245,13 @@ static int lenovo_input_mapping_tp10_ultrabook_kbd(struct hid_device *hdev,
 		}
 	}
 
+	/*
+	 * The Ultrabook Keyboard sends a spurious F23 key-press when resuming
+	 * from suspend and it does not actually have a F23 key, ignore it.
+	 */
+	if (usage->hid == 0x00070072)
+		return -1;
+
 	return 0;
 }
 
Signature · 1 line
2.26.2