The branch main has been updated by wulf:

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

commit e381dabcc58095d9be135b1027613cbf77a1ba7f
Author:     Joshua Rogers <jos...@joshua.hu>
AuthorDate: 2025-03-07 17:53:35 +0000
Commit:     Vladimir Kondratyev <w...@freebsd.org>
CommitDate: 2025-03-07 17:53:35 +0000

    wsp: Rename max_finger_area sysctl to max_finger_diameter
    
    The value of this sysctl is not an area, but a maximum diameter.
    
    Signed-off-by: Joshua Rogers <jos...@joshua.hu>
---
 share/man/man4/wsp.4    |  4 ++--
 sys/dev/usb/input/wsp.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4
index de2c121784d4..9fcec5133830 100644
--- a/share/man/man4/wsp.4
+++ b/share/man/man4/wsp.4
@@ -107,8 +107,8 @@ Enables movement on the trackpad follow a 
partially-released left-click.
 Default is 1 (enabled).
 .El
 .Bl -tag -width indent
-.It Va hw.usb.wsp.max_finger_area
-Specifies the maximum area on the trackpad which is registered as a
+.It Va hw.usb.wsp.max_finger_diameter
+Specifies the maximum finger diameter on the trackpad that is registered as a
 finger (a lower value is used for palm detection). Default is 1900.
 .El
 .Bl -tag -width indent
diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c
index 55289aa40b17..b9311ffd6c2d 100644
--- a/sys/dev/usb/input/wsp.c
+++ b/sys/dev/usb/input/wsp.c
@@ -101,7 +101,7 @@ static struct wsp_tuning {
        int     pressure_untouch_threshold;
        int     pressure_tap_threshold;
        int     scr_threshold;
-       int     max_finger_area;
+       int     max_finger_diameter;
        int     max_scroll_finger_distance;
        int     max_double_tap_distance;
        int     enable_single_tap_clicks;
@@ -120,7 +120,7 @@ static struct wsp_tuning {
        .pressure_untouch_threshold = 10,
        .pressure_tap_threshold = 120,
        .scr_threshold = 20,
-       .max_finger_area = 1900,
+       .max_finger_diameter = 1900,
        .max_scroll_finger_distance = MAX_FINGER_ORIENTATION/2,
        .max_double_tap_distance = 2500,
        .enable_single_tap_clicks = 1,
@@ -140,7 +140,7 @@ wsp_running_rangecheck(struct wsp_tuning *ptun)
        WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255);
        WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255);
        WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255);
-       WSP_CLAMP(ptun->max_finger_area, 1, 2400);
+       WSP_CLAMP(ptun->max_finger_diameter, 1, 2400);
        WSP_CLAMP(ptun->max_scroll_finger_distance, 1, MAX_FINGER_ORIENTATION);
        WSP_CLAMP(ptun->max_double_tap_distance, 1, MAX_FINGER_ORIENTATION);
        WSP_CLAMP(ptun->scr_threshold, 1, 255);
@@ -168,8 +168,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, 
pressure_untouch_threshold, CTLFLAG_RWTUN,
     &wsp_tuning.pressure_untouch_threshold, 0, "untouch pressure threshold");
 SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN,
     &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold");
-SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_area, CTLFLAG_RWTUN,
-    &wsp_tuning.max_finger_area, 0, "maximum finger area");
+SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_diameter, CTLFLAG_RWTUN,
+    &wsp_tuning.max_finger_diameter, 0, "maximum finger diameter");
 SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_scroll_finger_distance, CTLFLAG_RWTUN,
     &wsp_tuning.max_scroll_finger_distance, 0, "maximum scroll finger 
distance");
 SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN,
@@ -897,10 +897,10 @@ wsp_attach(device_t dev)
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_POSITION_Y, sc->sc_params->y);
        /* finger pressure */
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p);
-       /* finger touch area */
+       /* finger major/minor axis */
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MAJOR, sc->sc_params->w);
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MINOR, sc->sc_params->w);
-       /* finger approach area */
+       /* finger major/minor approach */
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_WIDTH_MAJOR, sc->sc_params->w);
        WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_WIDTH_MINOR, sc->sc_params->w);
        /* finger orientation */
@@ -1110,7 +1110,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t 
error)
                        switch (ntouch) {
                        case 1:
                                if (sc->index[0]->touch_major > 
tun.pressure_tap_threshold &&
-                                   sc->index[0]->tool_major <= 
tun.max_finger_area)
+                                   sc->index[0]->tool_major <= 
tun.max_finger_diameter)
                                        sc->ntaps = 1;
                                break;
                        case 2:
@@ -1216,7 +1216,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t 
error)
                                        dx = dy = 0;
 
                                /* Ignore unexpected movement when typing (palm 
detection) */
-                               if (ntouch == 1 && sc->index[0]->tool_major > 
tun.max_finger_area)
+                               if (ntouch == 1 && sc->index[0]->tool_major > 
tun.max_finger_diameter)
                                        dx = dy = 0;
 
                                if (sc->ibtn != 0 && ntouch == 1 && 

Reply via email to