Commit 43527a00 authored by Mikhail Khvainitski's avatar Mikhail Khvainitski Committed by Jiri Kosina
Browse files

HID: lenovo: Restrict detection of patched firmware only to USB cptkbd

Commit 46a0a2c9 ("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: 46a0a2c9 ("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: default avatarMikhail Khvainitski <me@khvoinitsky.org>
Tested-by: default avatarYauhen Kharuzhy <jekhor@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 31e52523
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -692,7 +692,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev,
		 * so set middlebutton_state to 3
		 * to never apply workaround anymore
		 */
		if (cptkbd_data->middlebutton_state == 1 &&
		if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD &&
				cptkbd_data->middlebutton_state == 1 &&
				usage->type == EV_REL &&
				(usage->code == REL_X || usage->code == REL_Y)) {
			cptkbd_data->middlebutton_state = 3;