Bug 291262 - Elantech touchpad not working correctly + patch
Summary: Elantech touchpad not working correctly + patch
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: Vladimir Kondratyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-28 09:58 UTC by David Lundqvist
Modified: 2026-04-22 20:08 UTC (History)
2 users (show)

See Also:


Attachments
Patch for psm for Elantech (591 bytes, patch)
2025-11-28 09:58 UTC, David Lundqvist
no flags Details | Diff
elan_middle_button.patch (2.32 KB, patch)
2025-12-03 13:06 UTC, Vladimir Kondratyev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Lundqvist 2025-11-28 09:58:47 UTC
Created attachment 265683 [details]
Patch for psm for Elantech

I have an Lenovo ThinkPad P53 with an "Elantech touchpad hardware v.4 firmware v.0x5f2001"

So the trackpoint works, so does the tree buttons for the trackpoint.
The trackpad does not work, no response, nor from the buttons below the trackpad. I did however accidentally discover that if I hod the middle button below the trackpad, it works and so does the buttons

I got some help on discord by Jordan Gordeev and he made a patch for this for the psm driver, attached below.
So the trackpad now works, partly.
3-finger scroll that I use on other Unix-like systems does not work, yet. Not sure if its driver or other software, like libinput that is problematic.

This problem persists on 16.0-CURRENT as I did a test install today, patch does not apply as psm has changed but I manually patched it all fine.

This may be a duplicate:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266742


I would love to help out more if I can.
Comment 1 Vladimir Kondratyev freebsd_committer freebsd_triage 2025-12-03 13:06:01 UTC
Created attachment 265798 [details]
elan_middle_button.patch

Test attached patch. It adds middle button support.

It should be done on top of very recent 16-CURRENT or with https://cgit.freebsd.org/src/commit/?id=e3201cec8381c0582374f93991eff4a71bb95e9b commit backported to test 3 fingers scroll as well.
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-02-10 23:00:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d85dcd1a9aa2e1b903935062500cb15b1a700f8

commit 3d85dcd1a9aa2e1b903935062500cb15b1a700f8
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2026-02-10 22:59:06 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2026-02-10 22:59:06 +0000

    psm(4): Add middle button support for Elantech V4 touchpads

    based on firmware version.

    PR:             291262
    MFC after:      1 month

 sys/dev/atkbdc/psm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Comment 3 David Lundqvist 2026-04-13 09:40:26 UTC
(In reply to commit-hook from comment #2)
This commit fixes this bug and most likely 266742 as well.
The touchpad seems to be fully supported by now when I tried on 16.0-CURRENT last week.
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-04-22 20:08:25 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=537159a587600a214698ea32fc7179c86b1afba3

commit 537159a587600a214698ea32fc7179c86b1afba3
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2026-02-10 22:59:06 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2026-04-22 19:59:01 +0000

    psm(4): Add middle button support for Elantech V4 touchpads

    based on firmware version.

    PR:             291262
    MFC after:      1 month

    (cherry picked from commit 3d85dcd1a9aa2e1b903935062500cb15b1a700f8)

 sys/dev/atkbdc/psm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)