From owner-svn-src-stable-11@freebsd.org Fri Feb 15 20:46:05 2019 Return-Path: Delivered-To: svn-src-stable-11@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 D9EBC14E8A4C; Fri, 15 Feb 2019 20:46:04 +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 808DC84126; Fri, 15 Feb 2019 20:46:04 +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 7675323EB1; Fri, 15 Feb 2019 20:46:04 +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 x1FKk4Kb049471; Fri, 15 Feb 2019 20:46:04 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1FKk4Wm049469; Fri, 15 Feb 2019 20:46:04 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201902152046.x1FKk4Wm049469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Fri, 15 Feb 2019 20:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r344165 - in stable/11/sys: dev/atkbdc sys X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/11/sys: dev/atkbdc sys X-SVN-Commit-Revision: 344165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 808DC84126 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 20:46:05 -0000 Author: wulf Date: Fri Feb 15 20:46:03 2019 New Revision: 344165 URL: https://svnweb.freebsd.org/changeset/base/344165 Log: MFC r343163: psm(4): detect Lenovo top-button clickpads libinput has special handling for Lenovo ThinkPad *40 series, where it treats clicks on the top button area as if they came from the TrackPoint: https://wayland.freedesktop.org/libinput/doc/latest/t440-support.html Detect these devices and set the corresponding evdev property. Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D18676 Modified: stable/11/sys/dev/atkbdc/psm.c stable/11/sys/sys/mouse.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Fri Feb 15 20:45:12 2019 (r344164) +++ stable/11/sys/dev/atkbdc/psm.c Fri Feb 15 20:46:03 2019 (r344165) @@ -136,6 +136,7 @@ struct psmcpnp_softc { enum { PSMCPNP_GENERIC, PSMCPNP_FORCEPAD, + PSMCPNP_TOPBUTTONPAD, } type; /* Based on PnP ID */ }; @@ -1823,6 +1824,8 @@ psm_register_synaptics(device_t dev) evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); if (sc->synhw.capClickPad) evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + if (sc->synhw.capClickPad && sc->synhw.topButtonPad) + evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD); evdev_support_key(evdev_a, BTN_TOUCH); evdev_support_nfingers(evdev_a, 3); psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); @@ -5717,7 +5720,7 @@ synaptics_sysctl_create_softbuttons_tree(struct psm_so */ /* hw.psm.synaptics.softbuttons_y */ - sc->syninfo.softbuttons_y = 1700; + sc->syninfo.softbuttons_y = sc->synhw.topButtonPad ? -1700 : 1700; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, "softbuttons_y", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, @@ -6447,6 +6450,9 @@ enable_synaptics(struct psm_softc *sc, enum probearg a case PSMCPNP_FORCEPAD: synhw.forcePad = 1; break; + case PSMCPNP_TOPBUTTONPAD: + synhw.topButtonPad = 1; + break; default: break; } @@ -6489,8 +6495,11 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.minimumYCoord); } if (synhw.capClickPad) { + printf(" Clickpad capabilities:\n"); printf(" forcePad: %d\n", synhw.forcePad); + printf(" topButtonPad: %d\n", + synhw.topButtonPad); } } buttons += synhw.capClickPad; @@ -7338,6 +7347,44 @@ static struct isa_pnp_id psmcpnp_ids[] = { }; /* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ +static struct isa_pnp_id topbtpad_ids[] = { + { 0x1700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0017, ThinkPad */ + { 0x1800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0018, ThinkPad */ + { 0x1900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0019, ThinkPad */ + { 0x2300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0023, ThinkPad */ + { 0x2a00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002a, ThinkPad */ + { 0x2b00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002b, ThinkPad */ + { 0x2c00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002c, ThinkPad */ + { 0x2d00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002d, ThinkPad */ + { 0x2e00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002e, ThinkPad */ + { 0x3300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0033, ThinkPad */ + { 0x3400ae30, "Lenovo PS/2 clickpad port" }, /* LEN0034, ThinkPad */ + { 0x3500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0035, ThinkPad */ + { 0x3600ae30, "Lenovo PS/2 clickpad port" }, /* LEN0036, ThinkPad */ + { 0x3700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0037, ThinkPad */ + { 0x3800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0038, ThinkPad */ + { 0x3900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0039, ThinkPad */ + { 0x4100ae30, "Lenovo PS/2 clickpad port" }, /* LEN0041, ThinkPad */ + { 0x4200ae30, "Lenovo PS/2 clickpad port" }, /* LEN0042, ThinkPad */ + { 0x4500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0045, ThinkPad */ + { 0x4700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0047, ThinkPad */ + { 0x4900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0049, ThinkPad */ + { 0x0020ae30, "Lenovo PS/2 clickpad port" }, /* LEN2000, ThinkPad */ + { 0x0120ae30, "Lenovo PS/2 clickpad port" }, /* LEN2001, ThinkPad */ + { 0x0220ae30, "Lenovo PS/2 clickpad port" }, /* LEN2002, ThinkPad */ + { 0x0320ae30, "Lenovo PS/2 clickpad port" }, /* LEN2003, ThinkPad */ + { 0x0420ae30, "Lenovo PS/2 clickpad port" }, /* LEN2004, ThinkPad */ + { 0x0520ae30, "Lenovo PS/2 clickpad port" }, /* LEN2005, ThinkPad */ + { 0x0620ae30, "Lenovo PS/2 clickpad port" }, /* LEN2006, ThinkPad */ + { 0x0720ae30, "Lenovo PS/2 clickpad port" }, /* LEN2007, ThinkPad */ + { 0x0820ae30, "Lenovo PS/2 clickpad port" }, /* LEN2008, ThinkPad */ + { 0x0920ae30, "Lenovo PS/2 clickpad port" }, /* LEN2009, ThinkPad */ + { 0x0a20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200a, ThinkPad */ + { 0x0b20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200b, ThinkPad */ + { 0 } +}; + +/* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ static struct isa_pnp_id forcepad_ids[] = { { 0x0d302e4f, "HP PS/2 forcepad port" }, /* SYN300D, EB 1040 */ { 0x14302e4f, "HP PS/2 forcepad port" }, /* SYN3014, EB 1040 */ @@ -7377,6 +7424,8 @@ psmcpnp_probe(device_t dev) if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) sc->type = PSMCPNP_FORCEPAD; + else if (ISA_PNP_PROBE(device_get_parent(dev), dev, topbtpad_ids) == 0) + sc->type = PSMCPNP_TOPBUTTONPAD; else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) sc->type = PSMCPNP_GENERIC; else Modified: stable/11/sys/sys/mouse.h ============================================================================== --- stable/11/sys/sys/mouse.h Fri Feb 15 20:45:12 2019 (r344164) +++ stable/11/sys/sys/mouse.h Fri Feb 15 20:46:03 2019 (r344165) @@ -136,6 +136,7 @@ typedef struct synapticshw { int infoXupmm; int infoYupmm; int forcePad; + int topButtonPad; } synapticshw_t; /* iftype */