From owner-freebsd-drivers@freebsd.org Wed May 29 22:18:09 2019 Return-Path: Delivered-To: freebsd-drivers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E11EC15AF0C1; Wed, 29 May 2019 22:18:08 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 554F08A1E9; Wed, 29 May 2019 22:18:06 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id DBD848F0E9; Thu, 30 May 2019 01:17:58 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id BKp1ts4iGFGV; Thu, 30 May 2019 01:17:50 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id 492E98F0DE; Thu, 30 May 2019 01:17:50 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id D2326422120; Thu, 30 May 2019 01:17:46 +0300 (MSK) X-Virus-Scanned: amavisd-new at cicgroup.ru Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id MD2R9AA0uNeu; Thu, 30 May 2019 01:17:43 +0300 (MSK) Received: from [192.168.0.30] (gateway [10.0.2.2]) by mail.cicgroup.ru (Postfix) with ESMTPA id CAE8842211C; Thu, 30 May 2019 01:17:43 +0300 (MSK) Subject: Re: Thinkpad t480s elantech touchpad device is not recognized: unknown touchpad firmware (firmware v.0x7f3001) To: freebsd-drivers@freebsd.org, FreeBSD X11 mailing list References: <5f4e1f25-8c87-5fa5-1d7f-edbde63fde6e@gmail.com> From: Vladimir Kondratyev Openpgp: preference=signencrypt Autocrypt: addr=vladimir@kondratyev.su; prefer-encrypt=mutual; keydata= mQENBFkI9Y8BCAC44UZYE8ZswFr/LHNHutuCmrbfP0j6jYl6zkW9VeM3cXVDjDsL3h9JhEFH zF9Or0muwHjspNuVdP2ot9vH8FCGAGEYS/GrzEEKxj4yoxAZxWnGUwzFiaf8fCtlrq5D9vOd /HSm6tb5YbcC/t/46hSwyPZ4i07rtsxmeozrKNx9H2gkcY0/AfmZ+UxY90/cj/F3aNk4wYLH gC95N99jaZvwPFX8wW5k++YaThXo8TNGQaxmC28cFFPdc1qICYdzYxS7kbTlGKp37lWmV9Z6 FursbfIkJZ7Rzw7NjGGijj4XjKif91ZwQNz/BfO58xrookQCibVCJ3JKcZo4NZ7rWTWlABEB AAG0LFZsYWRpbWlyIEtvbmRyYXR5ZXYgPHZsYWRpbWlyQGtvbmRyYXR5ZXYuc3U+iQFUBBMB CgA+FiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkJEuQCGwMFCQWjmoAFCwkIBwMFFQoJCAsF FgMCAQACHgECF4AACgkQg2u+IHApX3Wsmwf/bSUJeS0KXHQHH/XZwaqi0CfWxifrWfC+K62O DVA5TZZfZTs8h4Pov2DBvgx/DaQIVXeZazDPZho4v5SCrSulv//gboO6iN/7ZVnSRwQfyOp+ xnXLOzjC4mv4GjYc5sILJWQbWF4UPBGrBiFjtWrYjrRwVE6o/ThEXP92uu7suS2+U+f0zBh+ NZpJdf1T6EUN/dn8QLCyASNW1uYXzQ//5kTFc3ECC0VXzTnCZ7WWzkEOMbaVOwR25K5hCrg/ e41zrGlq8xLQhnXje+ZvG5DZkWKiZ0hUrB7nA8RLOVN6I1rzqStQjYxQuQqGu0Om/Bv6Rp+t AwEaLQdYOdXEyMZRe7kBDQRZCPWPAQgAt5NVWoIBXPqs/lo3w3JxUZ2f2R1bTqdWNBHlKI1Y r6WDHSMWT9WM/vycZSG5N6a051ZGhyPS6LNoxxqokYwgLr9VMsBTS7pA8Nx8hzyjIAAYCQqX 2tluX2FzvcJUaEZDo3pt93IpHzvf924A1nvxP4n9NyfTu4GBZ+07sBJEploKugmAVIzXD1m6 zr1xeo6LF5Adz1b0WP2cU88gv66FiuZp9Cj6DTGdIta6hQqAtrBxINVd5XR99eXrZ0+YSiIi 7ywa3dDti8NXwkZkn4pGPDkCjb34PL1kdoD/yOCpp9yAdflF8T8KObjWuivnAMOYfmGGN30n nhh8Ub9n2DVw7wARAQABiQE8BBgBCgAmFiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkI9Y8C GwwFCQWjmoAACgkQg2u+IHApX3XzJggAs8Hiu/YeLfmZYp/57eaK/BrtW5TeLrKd5x4knFkY dxWOJ7ZJIIr7fhUH9OZKyAMYPzJaWuxhAuDIZiH39MZFnAhx6LnycCIQMY6CP4gJ8Y2ssvf7 eNcFRqL1xvEmAELMC5HtpnLp914xlYkBoqcU2rH7X0Qza4GvafQHHVrjc+DqqKbF6YjPsEew Fp4mqvvIxi71UiWy95q0x8tC3Cbm5hUCl2i5nl0iaWNNMkuh6is+jLJZ9W5CfEPcp+W2Vekd UTm4zN0+uaR7br3Lr3GbBJPlLHrH1haK6nJmyfVzf1MbK8wqIHiH1wWmIxC96QHKCEzRDjdf IVYGqb/YykLjBw== Message-ID: <279a4144-43d3-6921-2047-e7877bfd721d@kondratyev.su> Date: Thu, 30 May 2019 01:17:20 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 554F08A1E9 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [0.22 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; NEURAL_HAM_MEDIUM(-0.07)[-0.071,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.60)[-0.598,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kondratyev.su]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.kondratyev.su]; NEURAL_HAM_SHORT(-0.10)[-0.098,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8299, ipnet:195.170.192.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[country: RU(0.01)] X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 22:18:09 -0000 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= =3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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: 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.