Hi Ulf,
Thanks for the reply. Yea I'm more than happy to test some patches, and
I already tested the one attached in your reply and unfortunately it did
not seem to work, mouse/pointer is back to beeing mainly unresponsive.
I can try describe the issue a bit better;
Lets say I try moving my finger from left to right over the touchpad,
maybe one of five times, the pointer changes position - but not in a
controlled way, it can be all from moving half the screen to just move
about the same length as the default input field for username in xenodm.
Both with your patch, and cvs HEAD(last commit) give me that behavior
while pms0 spams dmesg with the not in sync yet message.
Re email: I'll check the spam issue, and I'm following bugs@ :)
On 08/09/2019, 21:30, Ulf Brosziewski wrote:
Hi Mikal,
without the pms patch 1.89, your touchpad isn't recognized as touchpad,
and it will emulate a PS2 mouse. That's better than nothing, of course,
but only a workaround.
Would you mind to test one or two patches for pms? I've noticed that the
packet validation code is not complete. Below is a quick shot that should
correct it.
Regards,
Ulf
On 9/7/19 10:56 PM, Mikal Villa wrote:
First, thanks for all good advices.
Ok I finally had time to sit down and figure it out, and my first guess
was wrong, it was a change in pms.c which made the touchpad stop
working. The patch that made it stop work was revision 1.89 committed
Mon Aug 19 21:08 UTC. Most of the patch is probably correct, I've not
worked with hardware drivers on this level before so someone that knows
what they are doing should probably look into this - but I also made a
patch to fix it, however I might have broken the support of other
touchpads or so with my suggested change. What I did was bringing back
the three lines deleted from elantech_get_hwinfo_v4 and re-added them to
the new if statement. I'm attaching a diff for this change.
[...]
Index: dev/pckbc/pms.c
===================================================================
RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
retrieving revision 1.89
diff -u -p -r1.89 pms.c
--- dev/pckbc/pms.c 19 Aug 2019 21:08:26 -0000 1.89
+++ dev/pckbc/pms.c 8 Sep 2019 19:14:06 -0000
@@ -1952,6 +1952,9 @@ elantech_get_hwinfo_v4(struct pms_softc
elantech->fw_version = fw_version;
elantech->flags |= ELANTECH_F_REPORTS_PRESSURE;
+ if ((fw_version & 0x4000) == 0x4000)
+ elantech->flags |= ELANTECH_F_CRC_ENABLED;
+
if (elantech_set_absolute_mode_v4(sc))
return (-1);
@@ -2360,6 +2363,8 @@ int
pms_sync_elantech_v4(struct pms_softc *sc, int data)
{
if (sc->inputstate == 0) {
+ if (sc->elantech->flags & ELANTECH_F_CRC_ENABLED)
+ return (0);
if ((data & 0x0c) == 0x04)
return (0);
if ((sc->elantech->flags & ELANTECH_F_TRACKPOINT)
@@ -2372,7 +2377,10 @@ pms_sync_elantech_v4(struct pms_softc *s
case ELANTECH_V4_PKT_STATUS:
case ELANTECH_V4_PKT_HEAD:
case ELANTECH_V4_PKT_MOTION:
- return ((sc->packet[0] & 4) ? 0 : -1);
+ if (sc->elantech->flags & ELANTECH_F_CRC_ENABLED)
+ return ((data & 0x08) == 0 ? 0 : -1);
+ else
+ return ((sc->packet[0] & 4) ? 0 : -1);
case ELANTECH_PKT_TRACKPOINT:
return ((sc->packet[0] & 0xc8) == 0
&& sc->packet[1] == ((data & 0x10) << 3)
--
Best regards,
Mikal Villa