Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2019 01:17:20 +0300
From:      Vladimir Kondratyev <vladimir@kondratyev.su>
To:        freebsd-drivers@freebsd.org, FreeBSD X11 mailing list <freebsd-x11@freebsd.org>
Subject:   Re: Thinkpad t480s elantech touchpad device is not recognized: unknown touchpad firmware (firmware v.0x7f3001)
Message-ID:  <279a4144-43d3-6921-2047-e7877bfd721d@kondratyev.su>
In-Reply-To: <a179dbc9-3907-8c3d-c369-dd829896393b@gjunka.com>
References:  <5f4e1f25-8c87-5fa5-1d7f-edbde63fde6e@gmail.com> <a179dbc9-3907-8c3d-c369-dd829896393b@gjunka.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29.05.2019 20:17, Grzegorz Junka wrote:
> Hi Andrey,
>
> I don't know much about drivers but I would suggest reposting to X11
> list since it's as much related to drivers as it's to the GUI (and
> freebsd-drivers doesn't seem to be very active).
>
> GrzegorzJ
>
>
> On 16/05/2019 22:40, Andrey Kosachenko wrote:
>> Hi,
>>
>> Lenovo site sujests for t480s devices "ELAN UltraNav Driver for
>> Windows 10 64-bit - ThinkPad T480s (Type 20L7, 20L8)" driver. Which
>> made me think it is elantech (not synaptics). Looking through the psm
>> sources quickly led me to the point where a very simple modification
>> and recompilation of the kernel helped to recognize touchpad
>> properly. In particular:
>>
>> =3D=3D=3D
>> [silent@beastie][/usr/src]svnlite diff sys/dev/atkbdc/psm.c
>> Index: sys/dev/atkbdc/psm.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> --- sys/dev/atkbdc/psm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (re=
vision 347114)
>> +++ sys/dev/atkbdc/psm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (wo=
rking copy)
>> @@ -6929,7 +6929,7 @@
>> =C2=A0{
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 static const int ic2hw[] =3D
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*IC: 0=C2=A0 1=C2=A0 2=C2=A0=
 3=C2=A0 4=C2=A0 5=C2=A0 6=C2=A0 7=C2=A0 8=C2=A0 9=C2=A0 a=C2=A0 b=C2=A0 =
c=C2=A0 d=C2=A0 e=C2=A0 f */
>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { 0, 0, =
2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0 };
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { 0, 0, =
2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 };
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 static const int fw_sizes[]=
[3] =3D {
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 /* FW.vers=C2=A0 MaxX=C2=A0 MaxY */
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 { 0x020030, 1152,=C2=A0 768 },
>> =3D=3D=3D
>>
The patch looks good to me. Linux guys did exactly the same recently:

https://github.com/torvalds/linux/commit/10d900303f1c3a821eb0bef4e7b7ece1=
6768fba4#diff-e91bc4802c6797fe9acbdca0ed240be9

>> I.e. after that simple modification system started to recognize fw
>> version:
>>
>> =3D=3D=3D
>> [silent@beastie][/usr/src]dmesg | egrep psm
>> psm0: <PS/2 Mouse> irq 12 on atkbdc0
>> psm0: [GIANT-LOCKED]
>> psm0: model Elantech Touchpad, device ID 0
>> =3D=3D=3D
>>
>> and all expected touchpad features (multi-tap gestures and scrolling,
>> whatsoever) started to function properly under xorg+evdev. I'm happy
>> with a touchpad now however trackpoint stopped to work. In particular
>> attempt to use trackpoint causes strange flickering of the mice
>> cursor (which lasts few fractions of the second) after which cursor
>> jumps to the left-upper corner of the screen and it's impossible to
>> move it (via trackpoint) anymore (though swiping touchpad surface
>> moves cursor as expected). Also I found in Xorg.log messages emerging
>> when a palm touches the surface of a touchpad:

Andrey, please fill bugzilla PR and send me link to it. I believe
Elantech's trackpoint support has never been tested yet.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?279a4144-43d3-6921-2047-e7877bfd721d>