From owner-dev-commits-src-branches@freebsd.org Mon Aug 16 00:49:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF587669B11; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwY96MbPz4vt6; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C16791FE29; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0nndK099646; Mon, 16 Aug 2021 00:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0nnfb099645; Mon, 16 Aug 2021 00:49:49 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:49:49 GMT Message-Id: <202108160049.17G0nnfb099645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f2f52fbfdb28 - stable/13 - psm(4): Probe Synaptics touchpad with active multiplexing mode enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f2f52fbfdb282d740c02a92a47737c2c3f975791 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:49:50 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f2f52fbfdb282d740c02a92a47737c2c3f975791 commit f2f52fbfdb282d740c02a92a47737c2c3f975791 Author: Vladimir Kondratyev AuthorDate: 2021-07-14 10:30:26 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 00:47:18 +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 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 43d19b5174d3..f6276ae847aa 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -466,6 +466,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 */ @@ -666,6 +667,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; @@ -686,8 +688,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 */ @@ -6292,6 +6296,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 && (kbdc->quirks & KBDC_QUIRK_DISABLE_MUX_PROBE) != 0)) return (FALSE); @@ -6315,18 +6321,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; } } @@ -6348,7 +6352,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