From owner-svn-src-all@freebsd.org Sat Apr 20 21:06:13 2019 Return-Path: Delivered-To: svn-src-all@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 3605B1576118; Sat, 20 Apr 2019 21:06:13 +0000 (UTC) (envelope-from wulf@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0BC0721D5; Sat, 20 Apr 2019 21:06:12 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB0A1B905; Sat, 20 Apr 2019 21:06:12 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KL6CeM007932; Sat, 20 Apr 2019 21:06:12 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KL6CM0007931; Sat, 20 Apr 2019 21:06:12 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201904202106.x3KL6CM0007931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 20 Apr 2019 21:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346458 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 346458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0BC0721D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2019 21:06:13 -0000 Author: wulf Date: Sat Apr 20 21:06:12 2019 New Revision: 346458 URL: https://svnweb.freebsd.org/changeset/base/346458 Log: psm(4): give names to synaptics commands Submitted by: Ben LeMasurier MFC after: 2 weeks Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Apr 20 21:04:56 2019 (r346457) +++ head/sys/dev/atkbdc/psm.c Sat Apr 20 21:06:12 2019 (r346458) @@ -178,6 +178,22 @@ typedef struct packetbuf { #define PSM_PACKETQUEUE 128 #endif +/* + * Synaptics command definitions. + */ +#define SYNAPTICS_READ_IDENTITY 0x00 +#define SYNAPTICS_READ_MODES 0x01 +#define SYNAPTICS_READ_CAPABILITIES 0x02 +#define SYNAPTICS_READ_MODEL_ID 0x03 +#define SYNAPTICS_READ_SERIAL_PREFIX 0x06 +#define SYNAPTICS_READ_SERIAL_SUFFIX 0x07 +#define SYNAPTICS_READ_RESOLUTIONS 0x08 +#define SYNAPTICS_READ_EXTENDED 0x09 +#define SYNAPTICS_READ_CAPABILITIES_CONT 0x0c +#define SYNAPTICS_READ_MAX_COORDS 0x0d +#define SYNAPTICS_READ_DELUXE_LED 0x0e +#define SYNAPTICS_READ_MIN_COORDS 0x0f + typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -1119,7 +1135,7 @@ doopen(struct psm_softc *sc, int command_byte) "active multiplexing mode.\n", sc->unit); } - mouse_ext_command(sc->kbdc, 1); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODES); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || stat[1] == 0x47) && @@ -6158,7 +6174,7 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte */ if ((sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) && sc->hw.model == MOUSE_MODEL_SYNAPTICS && !(mode_byte & (1 << 5))) { - mouse_ext_command(sc->kbdc, 3); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODEL_ID); set_mouse_sampling_rate(sc->kbdc, 0xc8); } } @@ -6238,7 +6254,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a set_mouse_scaling(kbdc, 1); /* Identify the Touchpad version. */ - if (mouse_ext_command(kbdc, 0) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_IDENTITY) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6259,7 +6275,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Get the Touchpad model information. */ - if (mouse_ext_command(kbdc, 3) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODEL_ID) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6290,7 +6306,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Read the extended capability bits. */ - if (mouse_ext_command(kbdc, 2) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6321,7 +6337,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x08) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_RESOLUTIONS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6358,7 +6374,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 1) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x09) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_EXTENDED) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6397,7 +6414,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 4) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0c) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_CAPABILITIES_CONT) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6418,7 +6436,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMax) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0d) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MAX_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6439,7 +6458,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMin) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0f) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MIN_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6542,7 +6562,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a * byte of the response to this query to be a constant 0x3b, this * does not appear to be true for Touchpads with guest devices. */ - if (mouse_ext_command(kbdc, 1) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE);