The branch stable/12 has been updated by wulf:

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

commit e57850820d4732b248458007cad2e70c43156a90
Author:     Vladimir Kondratyev <[email protected]>
AuthorDate: 2021-07-14 10:30:26 +0000
Commit:     Vladimir Kondratyev <[email protected]>
CommitDate: 2021-08-16 00:58:41 +0000

    psm(4): Probe Synaptics touchpad with active multiplexing mode enabled
    
    if it is only multiplexed device. Also enable syncbit checks for them.
    This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop.
    
    Reported by:    Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info>
    PR:             253279
    Differential revision:  https://reviews.freebsd.org/D28502
    
    (cherry picked from commit f5998d20ed80fdc1cb3ba0c245cae5f179e22fe2)
---
 sys/dev/atkbdc/psm.c | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index f9b8b098ea87..cae4ac41fb32 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -465,6 +465,7 @@ struct psm_softc {          /* Driver status information */
        int             muxtpbuttons;   /* Touchpad button state */
        int             muxmsbuttons;   /* Mouse (trackpoint) button state */
        struct timeval  muxmidtimeout;  /* middle button supression timeout */
+       int             muxsinglesyna;  /* Probe result of single Synaptics */
 #ifdef EVDEV_SUPPORT
        struct evdev_dev *evdev_a;      /* Absolute reporting device */
        struct evdev_dev *evdev_r;      /* Relative reporting device */
@@ -665,6 +666,7 @@ static probefunc_t  enable_4dplus;
 static probefunc_t     enable_mmanplus;
 static probefunc_t     enable_synaptics;
 static probefunc_t     enable_synaptics_mux;
+static probefunc_t     enable_single_synaptics_mux;
 static probefunc_t     enable_trackpoint;
 static probefunc_t     enable_versapad;
 static probefunc_t     enable_elantech;
@@ -685,8 +687,10 @@ static struct {
         * WARNING: the order of probe is very important.  Don't mess it
         * unless you know what you are doing.
         */
-       { MOUSE_MODEL_SYNAPTICS,        /* Synaptics Touchpad on Active Mux */
+       { MOUSE_MODEL_SYNAPTICS,        /* Synaptics + mouse on Active Mux */
          0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux },
+       { MOUSE_MODEL_SYNAPTICS,        /* Single Synaptics on Active Mux */
+         0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_single_synaptics_mux },
        { MOUSE_MODEL_NET,              /* Genius NetMouse */
          0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_gmouse },
        { MOUSE_MODEL_NETSCROLL,        /* Genius NetScroll */
@@ -6256,6 +6260,8 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg 
arg)
        int active_ports_count = 0;
        int active_ports_mask = 0;
 
+       sc->muxsinglesyna = FALSE;
+
        if (mux_disabled == 1 || (mux_disabled == -1 &&
            (kbdcp(kbdc)->quirks & KBDC_QUIRK_DISABLE_MUX_PROBE) != 0))
                return (FALSE);
@@ -6279,18 +6285,16 @@ enable_synaptics_mux(struct psm_softc *sc, enum 
probearg arg)
                    active_ports_count);
 
        /* psm has a special support for GenMouse + SynTouchpad combination */
-       if (active_ports_count >= 2) {
-               for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) {
-                       if ((active_ports_mask & 1 << port) == 0)
-                               continue;
-                       VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port));
-                       set_active_aux_mux_port(kbdc, port);
-                       probe = enable_synaptics(sc, arg);
-                       if (probe) {
-                               if (arg == PROBE)
-                                       sc->muxport = port;
-                               break;
-                       }
+       for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) {
+               if ((active_ports_mask & 1 << port) == 0)
+                       continue;
+               VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port));
+               set_active_aux_mux_port(kbdc, port);
+               probe = enable_synaptics(sc, arg);
+               if (probe) {
+                       if (arg == PROBE)
+                               sc->muxport = port;
+                       break;
                }
        }
 
@@ -6312,7 +6316,17 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg 
arg)
        }
        empty_both_buffers(kbdc, 10);   /* remove stray data if any */
 
-       return (probe);
+       /* Don't disable syncbit checks if Synaptics is only device on MUX */
+       if (active_ports_count == 1)
+               sc->muxsinglesyna = probe;
+       return (active_ports_count != 1 ? probe : FALSE);
+}
+
+static int
+enable_single_synaptics_mux(struct psm_softc *sc, enum probearg arg)
+{
+       /* Synaptics device is already initialized in enable_synaptics_mux */
+       return (sc->muxsinglesyna);
 }
 
 static int
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to