aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/input/wsp.c
Commit message (Collapse)AuthorAgeFilesLines
* wsp(4): Make evdev interface operational if sysmouse one is not openedVladimir Kondratyev2026-04-121-1/+10
| | | | | | | | | | | Before this change evdev interface sent only copy of data sent through the sysmouse interface. It worked as /dev/wsp0 device node was automatcaly opened by devd(8) with starting of moused(8). Starting with 15.0 moused(8) does not open sysmouse interface by default thus making wsp(4) device dysfunctional. Fix it with adding extra checks of interfaces state. MFC after: 1 week
* wsp(4): Do not handle pressure on non-ForceTouch devicesVladimir Kondratyev2026-04-121-2/+4
| | | | | | | They always report it value as zero breaking pressure-driven drivers like moused(8) and xf86-input-synaptics. MFC after: 1 week
* wsp: Fix whitespacesJoshua Rogers2025-03-071-9/+11
| | | | Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* wsp: Rename max_finger_area sysctl to max_finger_diameterJoshua Rogers2025-03-071-9/+9
| | | | | | The value of this sysctl is not an area, but a maximum diameter. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* wsp: Handle horizontal scrolling and create tunable for swipe/scroll.Joshua Rogers2025-03-071-31/+82
| | | | | | | | | | | | | | | | | | | | | | | | Previously, a two-finger horizontal scroll would result in a forwards/backwards keyboard event being performed. This patch changes that functionality to be specified via two new sysctls: horizontal_swipe_finger_count and scroll_finger_count. The former specifies how many fingers are used to perform the aforementioned forwards/backwards keyboard event, while the latter specifies how many fingers are used to perform horizontal scrolling. 0 disables each of them. The threshold for scrolling has been coupled into a single tunable: scr_threshold. This tunable is used for both scrolling and the horizontal swipe. t_factor and t_invert tunables have been created in the same manner as their z-axis counterparts. Horizontal scrolling is disabled by default, as it requires the sysctl hw.usb.wsp.t_factor to 3 (wsp mode). Horizontal swiping is enabled by default with a three-finger tap. Also rewrite much of, and improve, documentation. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* wsp: Fix typo in function name.Joshua Rogers2025-03-071-2/+2
| | | | Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* wsp: Add hw.usb.wsp.max_scroll_finger_distance for two-finger scrollingJoshua Rogers2025-03-071-2/+7
| | | | | | | | | | | | | | | The hw.usb.wsp.max_scroll_finger_distance sysctl may be used to specify the maximum distance between two fingers which are registered as a z-axis (vertical scroll with mousepad) movement. Previously, this was shared with the tunable hw.usb.wsp.max_double_tap_distance which is used to specify the maximum distance between two fingers which register as a right-click. This patch also cleans up and add new information to the manpage for wsp(4). Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* wsp: Raise the default scr_hor_threshold sysctl.Joshua Rogers2025-03-071-1/+1
| | | | | | | The previous value caused nearly every horizontal movement to be classed as a left/right-keyboard button-click. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
* usb: Kill left-over cdefs.h includesWarner Losh2025-03-041-1/+0
| | | | | | | | | These includes were for __FBSD_RCSID() macro. They weren't formatted like the rest of the tree so weren't trimmed automatically when that script was run. Trim them now. MFC After: 1 week Sponsored by: Netflix
* wsp: Use already-calculated distance of fingers for comparison.Joshua Rogers2024-09-061-3/+1
| | | | | | | | | Also correctly use tun.max_double_tap_distance for maximum distance of fingers for vertical scrolling. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* wsp: Improve multi-finger touchpad usage and allow more configurationsJoshua Rogers2024-09-061-29/+56
| | | | | | | | | | | | | | | | | | | | This patch allows scrolling with multiple fingers simultaneously, in line with how wsp trackpads function on MacOS. Two new tunables are added: hw.usb.wsp.max_finger_area and hw.usb.wsp.max_double_tap_distance. max_finger_area defines the maximum size which the driver registered an object on trackpad as a finger. Previously, this value was hardcoded as 1200, which was too low to register thumb-clicks. max_double_tap_distance defines the maximum distance between two fingers which will register as a double-click. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* wsp: Allow the trackpad to be used after a partially unreleased click.Joshua Rogers2024-09-061-2/+8
| | | | | | | | | | This provides functionality for a click which is partially unreleased and then allows the user to continue moving the mousepad as if were not invoked as a full click Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* usb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-3/+1
|
* wsp_intr_callback: eliminate write only variable hWarner Losh2022-04-051-3/+0
| | | | Sponsored by: Netflix
* wsp(4): Add evdev support.Vladimir Kondratyev2021-08-241-20/+285
| | | | | | | | Reviewed by: hselasky Tested by: Greg V, Constantin Furst<constantin_AT_fuersten_DOT_info> MFC after: 2 weeks PR: 252236 Differential revision: https://reviews.freebsd.org/D31653
* wsp(4): Compact parameter structure.Vladimir Kondratyev2021-08-241-199/+96
| | | | MFC after: 2 weeks
* atp(4), wsp(4): Return correct priority from probe() method;Vladimir Kondratyev2021-08-241-1/+4
| | | | MFC after: 2 weeks
* wsp: Add sysctl tunable for Z-Axis inversionVladimir Kondratyev2021-02-081-1/+6
| | | | | | | | | | 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 <james.wright_AT_digital-chaos_DOT_com> Reviewed by: wulf PR: 253321 Differential revision: https://reviews.freebsd.org/D28521
* hid: Chase for HID function name changes in existing USB HID driversVladimir Kondratyev2021-01-071-1/+4
| | | | | | | | | | Also hide shim code added in a previous commit under COMPAT_USBHID12. Note: it is enough to add -DCOMPAT_USBHID12 to CFLAGS to compile old code with new HID subsystem, but it is not enough to link it at runtime. HID dependency has to be added explicitly with MODULE_DEPEND macro. Reviewed by: manu, hselasky (as part of D27887)
* Factor-out hardware-independent part of USB HID support to new moduleVladimir Kondratyev2021-01-071-0/+1
| | | | | | | | It will be used by the upcoming HID-over-i2C implementation. Should be no-op, except hid.ko module dependency is to be added to affected drivers. Reviewed by: hselasky, manu Differential revision: https://reviews.freebsd.org/D27867
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-4/+0
| | | | Notes: svn path=/head/; revision=365084
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-151-1/+2
| | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Reviewed by: hselasky, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23632 Notes: svn path=/head/; revision=357972
* Add support for right and middle click with integrated button to WSPHans Petter Selasky2018-03-271-1/+6
| | | | | | | | | | | | USB trackpad driver. Submitted by: James Wright <james.wright@jigsawdezign.com> PR: 226961 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=331642
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Make wsp process a single touchpad tap and interpret it as aWarner Losh2017-03-011-1/+6
| | | | | | | | | | | left-click event. It can be disabled setting the new hw.usb.wsp.enable_single_tap_clicks sysctl to 0. Submitted by: K Staring <qdk@quickdekay.net> Pull Request: https://github.com/freebsd/freebsd/pull/97 Notes: svn path=/head/; revision=314467
* dev/usb: minor spelling fixes in comments.Pedro F. Giffuni2016-05-021-1/+1
| | | | | | | | | No functional change. Reviewed by: hselasky Notes: svn path=/head/; revision=298932
* Create a USB_PNP_INFO and use it to export the existing PNPWarner Losh2015-12-111-0/+1
| | | | | | | | | | | | | | tables. Some drivers needed some slight re-arrangement of declarations to accommodate this. Change the USB pnp tables slightly to allow better compatibility with the system by moving linux driver info from start of each entry to the end. All other PNP tables in the system have the per-device flags and such at the end of the elements rather that at the beginning. Differential Review: https://reviews.freebsd.org/D3458 Notes: svn path=/head/; revision=292080
* Update the wsp driver to support newer touch pads, like found inHans Petter Selasky2015-11-101-106/+277
| | | | | | | | | | | MacBookPro11,4 and MacBook12,1. This update adds support for the force touch parameter. PR: 204420 MFC after: 1 week Notes: svn path=/head/; revision=290639
* Make a bunch of USB debug SYSCTLs tunable, so that their value(s) canHans Petter Selasky2015-01-051-7/+7
| | | | | | | be set before the USB device(s) are probed. Notes: svn path=/head/; revision=276701
* - Make pointer easier to control when moving slowly.Hans Petter Selasky2014-03-011-6/+26
| | | | | | | | | | - Increase chance of vertical scrolling as vertical scrolling is used more often. Submitted by: Huang Wen Hui <huanghwh@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=262663
* Updates for WSP driver:Hans Petter Selasky2014-02-251-8/+17
| | | | | | | | | | | | | | 1) Add support for page back/forward. 2) While doing HOR scrolling, disable VER scrolling. 3) Checking dx_sum and dy_sum before emulate right button, this can avoids unexpected right button press. 4) Fix stable pointer operation when emulating middle button. Submitted by: Huang Wen Hui <huanghwh@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=262477
* - Remove not needed definitions from driver.Hans Petter Selasky2014-02-131-270/+43
| | | | | | | | | | | - Get USB input report length from HID descriptor. - Use 1 finger TAP for devices which has no integrated button. - Move data buffer to softc instead of allocating it. MFC after: 1 week Notes: svn path=/head/; revision=261827
* Add a comment about the origin of some structures, defines and so on.Hans Petter Selasky2014-02-011-0/+19
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=261343
* Fix for unexpected selection with two fingers sometimes.Hans Petter Selasky2014-01-311-17/+34
| | | | | | | | | | Fix for unexpected scrolling when click with two fingers. Submitted by: Huang Wen Hui <huanghwh@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=261315
* - Remove some dead code.Hans Petter Selasky2014-01-291-87/+37
| | | | | | | | | | | - Use system provided functions for HID report requests. - Nice the mode setting, because the USB hardware does appear to handle the commands right away. MFC after: 1 week Notes: svn path=/head/; revision=261262
* Add support for trackpads found in Apple MacBook products. While at itHans Petter Selasky2014-01-291-0/+1438
add some missing devd entries. Submitted by: Huang Wen Hui <huanghwh@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=261260