-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-kernel: hid-lenovo: detect false-positives
This patch allows the workaround to work again when wheel signals are detected after identifying the keyboard as bug-free. False positives happen when the middle button is released while the kernel doesn't see it.
- Loading branch information
Showing
7 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
runtime-kernel/linux-kernel/autobuild/patches/0023-hid-lenovo-detect-false-positives.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From f075ddc9ed7ce3cc5aa83df98442f71d51fa1688 Mon Sep 17 00:00:00 2001 | ||
From: Henry Chen <[email protected]> | ||
Date: Thu, 4 Jan 2024 00:05:49 -0500 | ||
Subject: [PATCH] hid-lenovo: detect false-positives | ||
|
||
This patch allows the workaround to work again when wheel signals | ||
are detected after identifying the keyboard as bug-free. False | ||
positives happen when the middle button is released while the | ||
kernel doesn't see it. | ||
--- | ||
drivers/hid/hid-lenovo.c | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c | ||
index 149a3c74346b..2db6f85cb4a1 100644 | ||
--- a/drivers/hid/hid-lenovo.c | ||
+++ b/drivers/hid/hid-lenovo.c | ||
@@ -686,7 +686,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev, | ||
{ | ||
struct lenovo_drvdata *cptkbd_data = hid_get_drvdata(hdev); | ||
|
||
- if (cptkbd_data->middlebutton_state != 3) { | ||
+ if (cptkbd_data->middlebutton_state != 3 || | ||
+ (usage->code == REL_WHEEL || usage->code == REL_HWHEEL)) { | ||
/* REL_X and REL_Y events during middle button pressed | ||
* are only possible on patched, bug-free firmware | ||
* so set middlebutton_state to 3 | ||
-- | ||
2.39.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters