From nobody Sun Apr 30 06:58:04 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH118jyz48sJp; Sun, 30 Apr 2023 06:58:05 +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 4Q8HH0511Hz3NDq; Sun, 30 Apr 2023 06:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9PqZPblq84cRhuydX+/EMMzyrpJEzr81Sf+yb6CH84=; b=OJesznYqEK7uSl5bWgXkRynmxJC9GDUOkva5nWQd1YCACDL5fkYDqDmpLsr59c+vn4ny2p 6rbRSA405DM/8Zh9HdKNeM7a3f3RrlEDcbkzV31VSEI9JhJ8as4h6WnKjSgFRbcSYmw+Pd PiUPdw/hlz4Fihy/8C8UMaFPT2SqhFKpgcS/Y2x5tWxKOGg270D5DEztivhPPH18+7lvrv I61meZHLNVc7RsssMTQa7FyQOY/K9Jj7DN1wM+AZeOTNcWaASepajZ2NAGcKegpHK8IEb4 34PLrwBYJX1sOZ+PdGvkiZfl3+WKL3WwOKypg+B9rprIbHfJrGSMJ5yKkCqXbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9PqZPblq84cRhuydX+/EMMzyrpJEzr81Sf+yb6CH84=; b=eHriEpWejZMTtac/mVphUMU3DJ4xY5/xIrwD/mszG4o20l1qejK9luKjke9CyHg3nWusu9 Ii3PTBYd+LLqD8L+w2KYMWgggtXfiirhK2mFzitmB42/Pj5VcGmkxsDBmVC449TJujPxYc y8us04NhEhGVtNhygvY61Y3s5QIJknrfgUEQTvyLoN1jNV2lUe0WhP6bgZcoQy72liUDLj StV2kpQBTpzvtnEwIzNNX58ARpJTfUu/aqMxgiExp+1x69K6dlR5uEgCKwVRU7NV5GZj0x 5Q1m9N+R2Fp1IsE2CTzo/g5rJMMbv46AeYfiAxVlt2lgcntS5wVlY2lVo11g0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837884; a=rsa-sha256; cv=none; b=cOiAZ+5N+OWO+QcHf3H5cclgYVMmvSGrj8yvJCm/hOszURT9dZ1tvIwTK9UEHPQkP/pQFu tGylyMNntcVBkMYGE9IgzKP0dKKp4L7bmhxrk87LW7l8sp3PpdOPg4l7wZ9IdFKC4zHBMT 9ra/7XcbuENpLdJ/5bKWv2u5/o9WplpCOuoqnq1f2By1ppxbr0PVGalt9IjcwqrA34RR3d kIdMQZVFhg42hyvJXfNJcPDsv0lK1jgeWxzSbtX9hY8p965G5xAtZwylWphOiPC0vzLYSP ZxxY515Xih7JietM1FwBtKFuLsC86CHSHqf77tbfBkuzb/0sRHCl1GyJHmuRvg== 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 4Q8HH03l3HzDsw; Sun, 30 Apr 2023 06:58:04 +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 33U6w49O071744; Sun, 30 Apr 2023 06:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w4gG071743; Sun, 30 Apr 2023 06:58:04 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:04 GMT Message-Id: <202304300658.33U6w4gG071743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 00e2c99eb73a - stable/13 - wsp: Add sysctl tunable for Z-Axis inversion List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 00e2c99eb73aca5e46940c7993631314d485713a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=00e2c99eb73aca5e46940c7993631314d485713a commit 00e2c99eb73aca5e46940c7993631314d485713a Author: Vladimir Kondratyev AuthorDate: 2021-02-08 21:26:42 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 wsp: Add sysctl tunable for Z-Axis inversion This adds a new sysctl to Wellspring Touchpad driver for controlling Z-Axis (2-finger vertical scroll) direction "hw.usb.wsp.z_invert". Submitted by: James Wright Reviewed by: wulf PR: 253321 Differential revision: https://reviews.freebsd.org/D28521 (cherry picked from commit d8c6d4c7321d4c969216bda8f792b45ed00afd64) --- share/man/man4/wsp.4 | 7 ++++++- sys/dev/usb/input/wsp.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 70a1219533dc..847c79c71f29 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2018 +.Dd February 9, 2021 .Dt WSP 4 .Os .Sh NAME @@ -67,6 +67,11 @@ Pointer sensitivity can be controlled using the sysctl tunable Tap to left-click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_clicks , set to 0 to disable single tap clicks or 1 to enable them (default). +Z-Axis sensitivity can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_factor . +Z-Axis inversion can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_invert , +set to 0 to disable (default) or 1 to enable inversion. .Sh FILES .Nm creates a blocking pseudo-device file, diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index b1492f1f4c0c..c2da3df598c5 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -95,6 +95,7 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, debug, CTLFLAG_RWTUN, static struct wsp_tuning { int scale_factor; int z_factor; + int z_invert; int pressure_touch_threshold; int pressure_untouch_threshold; int pressure_tap_threshold; @@ -105,6 +106,7 @@ static struct wsp_tuning { { .scale_factor = 12, .z_factor = 5, + .z_invert = 0, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, @@ -117,6 +119,7 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) { WSP_CLAMP(ptun->scale_factor, 1, 63); WSP_CLAMP(ptun->z_factor, 1, 63); + WSP_CLAMP(ptun->z_invert, 0, 1); WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); @@ -128,6 +131,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, &wsp_tuning.scale_factor, 0, "movement scale factor"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_factor, CTLFLAG_RWTUN, &wsp_tuning.z_factor, 0, "Z-axis scale factor"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_invert, CTLFLAG_RWTUN, + &wsp_tuning.z_invert, 0, "enable Z-axis inversion"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_touch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_touch_threshold, 0, "touch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, @@ -1226,7 +1231,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) - dz = sc->dz_sum / tun.z_factor; + dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); if (sc->scr_mode == WSP_SCR_HOR || abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE)