]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround
authorMikhail Khvainitski <me@khvoinitsky.org>
Sat, 23 Sep 2023 22:58:30 +0000 (01:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:18 +0000 (16:56 +0000)
commit8d25ec69f8f167977667852911f46991831276d1
tree5c1e9ef906a0f8372e7e082ba753b3075a2d5fc5
parent64f062baf202b82f54987a3f614a6c8f3e466641
HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround

[ Upstream commit 46a0a2c96f0f47628190f122c2e3d879e590bcbe ]

Built-in firmware of cptkbd handles scrolling by itself (when middle
button is pressed) but with issues: it does not support horizontal and
hi-res scrolling and upon middle button release it sends middle button
click even if there was a scrolling event. Commit 3cb5ff0220e3 ("HID:
lenovo: Hide middle-button press until release") workarounds last
issue but it's impossible to workaround scrolling-related issues
without firmware modification.

Likely, Dennis Schneider has reverse engineered the firmware and
provided an instruction on how to patch it [1]. However,
aforementioned workaround prevents userspace (libinput) from knowing
exact moment when middle button has been pressed down and performing
"On-Button scrolling". This commit detects correctly-behaving patched
firmware if cursor movement events has been received during middle
button being pressed and stops applying workaround for this device.

Link: https://hohlerde.org/rauch/en/elektronik/projekte/tpkbd-fix/
Signed-off-by: Mikhail Khvainitski <me@khvoinitsky.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-lenovo.c