Skip to content

Commit 43527a0

Browse files
m-khvoinitskyJiri Kosina
authored andcommitted
HID: lenovo: Restrict detection of patched firmware only to USB cptkbd
Commit 46a0a2c ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") introduced a regression for ThinkPad TrackPoint Keyboard II which has similar quirks to cptkbd (so it uses the same workarounds) but slightly different so that there are false-positives during detecting well-behaving firmware. This commit restricts detecting well-behaving firmware to the only model which known to have one and have stable enough quirks to not cause false-positives. Fixes: 46a0a2c ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") Link: https://lore.kernel.org/linux-input/ZXRiiPsBKNasioqH@jekhomev/ Link: https://bbs.archlinux.org/viewtopic.php?pid=2135468#p2135468 Signed-off-by: Mikhail Khvainitski <[email protected]> Tested-by: Yauhen Kharuzhy <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 31e5252 commit 43527a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/hid/hid-lenovo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev,
692692
* so set middlebutton_state to 3
693693
* to never apply workaround anymore
694694
*/
695-
if (cptkbd_data->middlebutton_state == 1 &&
695+
if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD &&
696+
cptkbd_data->middlebutton_state == 1 &&
696697
usage->type == EV_REL &&
697698
(usage->code == REL_X || usage->code == REL_Y)) {
698699
cptkbd_data->middlebutton_state = 3;

0 commit comments

Comments
 (0)