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

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#p2135468Signed-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
...@@ -692,7 +692,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev, ...@@ -692,7 +692,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev,
* so set middlebutton_state to 3 * so set middlebutton_state to 3
* to never apply workaround anymore * 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->type == EV_REL &&
(usage->code == REL_X || usage->code == REL_Y)) { (usage->code == REL_X || usage->code == REL_Y)) {
cptkbd_data->middlebutton_state = 3; cptkbd_data->middlebutton_state = 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment