TrackPoint doubletap enablement and user control
Subsystems (6)
v5 cover TrackPoint doubletap enablement and user control
This patch series adds support for TrackPoint doubletap with a clear and simple separation of responsibilities between drivers:
1. Firmware enablement (trackpoint.c):
Automatically enables doubletap on capable hardware during device detection.
2. User control (thinkpad_acpi.c):
Provides a sysfs interface to enable or disable delivery of doubletap events to userspace.
The approach follows the KISS principle:
- The TrackPoint driver enables hardware functionality by default.
- The thinkpad_acpi driver controls whether ACPI doubletap events are delivered, using existing hotkey filtering infrastructure.
- No cross-driver APIs or dual filtering paths are introduced.
Changes in v5:
- Rename sysfs attribute from doubletap_filter to doubletap_enable to reflect actual behavior.
- Fix inverted logic so events are delivered only when doubletap is enabled.
- Suppress ACPI hotkey delivery instead of injecting or filtering input events.
- Register the sysfs attribute via hotkey_attributes[] instead of device_create_file().
- Drop unnecessary helper wrappers and debug logging.
- Update Documentation to reflect the new naming and semantics.
Changes in v4:
- Complete redesign based on reviewer feedback.
- trackpoint.c: Simplified to only enable doubletap by default.
- trackpoint.c: Removed all sysfs attributes and global variables.
- trackpoint.c: Uses firmware ID detection with deny list.
- thinkpad_acpi.c: Added sysfs interface for kernel-level event control.
- thinkpad_acpi.c: No cross-driver dependencies.
- Documentation: Updated to reflect simplified sysfs approach.
Changes in v3:
- No changes.
Changes in v2:
- Improved commit messages.
- Removed unnecessary comments and debug messages.
- Switched to strstarts() usage.
- Simplified firmware capability detection logic.
This version addresses the remaining review feedback by correcting the naming and logic inversion, aligning sysfs semantics with behavior, and fully integrating with existing thinkpad_acpi hotkey handling.
Vishnu Sankar (3):
input: trackpoint - Enable doubletap by default on capable devices platform/x86: thinkpad_acpi: Add sysfs control for TrackPoint
double-tap
Documentation: thinkpad-acpi - Document doubletap_enable attribute
.../admin-guide/laptops/thinkpad-acpi.rst | 20 ++++++++ drivers/input/mouse/trackpoint.c | 47 +++++++++++++++++++ drivers/input/mouse/trackpoint.h | 5 ++ drivers/platform/x86/lenovo/thinkpad_acpi.c | 42 ++++++++++++++--- 4 files changed, 107 insertions(+), 7 deletions(-)
Signature · 1 line
2.51.0
PATCH v5 1/3 input: trackpoint - Enable doubletap by default on capable devices
Enable doubletap functionality by default on TrackPoint devices that support it. The feature is detected using firmware ID pattern matching (PNP: LEN03xxx) with a deny list of incompatible devices.
This provides immediate doubletap functionality without requiring userspace configuration. The hardware is enabled during device detection, while event filtering continues to be handled by the thinkpad_acpi driver as before.
---
Changes in v5:
- Renamed function to trackpoint_is_dt_capable()
- Simplified string comparison without sscanf()
- Removed wrapper function as suggested
- Fixed missing period in comment
Changes in v4:
- Simplified approach: removed all sysfs attributes and user interface
- Enable doubletap by default during device detection
- Removed global variables and complex attribute infrastructure
- Uses minimal firmware ID detection with deny list
- Follows KISS principle as suggested by reviewers
Changes in v3:
- No changes
Changes in v2:
- Improve commit messages
- Sysfs attributes moved to trackpoint.c
- Removed unnecessary comments
- Removed unnecessary debug messages
- Using strstarts() instead of strcmp()
- is_trackpoint_dt_capable() modified
- Removed _BIT suffix and used BIT() define
- Reverse the trackpoint_doubletap_status() logic to return error first
- Removed export functions as a result of the design change
- Changed trackpoint_dev->psmouse to parent_psmouse
- The path of trackpoint.h is not changed
--- drivers/input/mouse/trackpoint.c | 47 ++++++++++++++++++++++++++++++++ drivers/input/mouse/trackpoint.h | 5 ++++ 2 files changed, 52 insertions(+)
drivers/input/mouse/trackpoint.c +47 -0
@@ -393,6 +393,45 @@ static int trackpoint_reconnect(struct psmouse *psmouse)return 0 ; } +/* List of known incapable device PNP IDs */ +static const char *const dt_incompatible_devices[] = { +"LEN0304" , +"LEN0306" , +"LEN0317" , +"LEN031A" , +"LEN031B" , +"LEN031C" , +"LEN031D" , +}; + +/* +* Checks if it's a doubletap capable device. +* The PNP ID format is "PNP: LEN030d PNP0f13". +*/ +static bool trackpoint_is_dt_capable (const char *pnp_id) +{ +size_t i; + +if (!pnp_id) +return false; + +/* Must start with "PNP: LEN03" */ +if (!strstarts (pnp_id,"PNP: LEN03" )) +return false; + +/* Ensure enough length before comparing */ +if (strlen (pnp_id) <12 ) +return false; + +/* Check deny-list */ +for (i =0 ; i <ARRAY_SIZE (dt_incompatible_devices); i++) { +if (!strncmp (pnp_id +5 , + dt_incompatible_devices[i],7 )) +return false; + } +return true; +} +int trackpoint_detect (struct psmouse *psmouse,bool set_properties) {struct ps2dev *ps2dev = &psmouse->ps2dev;
@@ -470,6 +509,14 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) psmouse->vendor, firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); +/* Enable doubletap by default on capable devices */ +if (trackpoint_is_dt_capable (ps2dev->serio->firmware_id)) { +if (trackpoint_write (ps2dev,TP_DOUBLETAP ,TP_DOUBLETAP_ENABLE )) +psmouse_warn (psmouse,"Failed to enable doubletap: %d\n" , error); +else +psmouse_info (psmouse,"Doubletap enabled by default!\n" ); + } +return 0 ; }
drivers/input/mouse/trackpoint.h +5 -0
@@ -69,6 +69,8 @@/* (how hard it is to drag */ /* with Z-axis pressed) */ +#define TP_DOUBLETAP 0x58/* TrackPoint doubletap register */ +#define TP_MINDRAG 0x59/* Minimum amount of force needed */ /* to trigger dragging */
@@ -110,6 +112,9 @@external device will be forced to 1 */ #define TP_MASK_EXT_TAG 0x04 +/* Doubletap register values */ +#define TP_DOUBLETAP_ENABLE 0xFF/* Enable value */ +#define TP_DOUBLETAP_DISABLE 0xFE/* Disable value */ /* Power on Self Test Results */ #define TP_POR_SUCCESS 0x3B
Signature · 1 line
2.51.0
PATCH v5 2/3 platform/x86: thinkpad_acpi: Add sysfs control for TrackPoint double-tap
In reply to Vishnu SankarAdd a sysfs attribute to enable or disable TrackPoint double-tap hotkey events at the kernel level.
The TrackPoint firmware enables double-tap support automatically. This interface allows userspace to control whether double-tap events are forwarded to userspace.
The attribute is available at:
/sys/devices/platform/thinkpad_acpi/doubletap_enable
0 - Disable double-tap hotkey events
1 - Enable double-tap hotkey events (default)
Filtering is implemented by suppressing ACPI hotkey delivery without injecting synthetic input events.
---
Changes in v2:
- Updated commit message to clarify dependency on trackpoint driver
- Now handling sysfs read/write of trackpoint driver using file read/write
- Removed sysfs attribute creation of trackpoint double tap here
- Reversed the logic and return false right away
- Dropped unnecessary debug messages
- Using dev_dbg() instead of pr_xxxx()
Changes in v3:
- No changes
Changes in v4:
- Simplified approach: single sysfs attribute for user control
- Clear naming: doubletap_filter instead of doubletap_enabled
- Intuitive behavior: 0=process events, 1=filter events
- No cross-driver dependencies or complex interactions
- Minimal code changes using existing thinkpad_acpi infrastructure
Changes in v5:
- Rename doubletap_filter to doubletap_enable to match actual behavior
- Fix inverted logic so events are emitted only when doubletap is enabled
- Register sysfs attribute via hotkey_attributes[] (no device_create_file)
---
--- drivers/platform/x86/lenovo/thinkpad_acpi.c | 42 +++++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-)
drivers/platform/x86/lenovo/thinkpad_acpi.c +35 -7
@@ -373,7 +373,7 @@ static struct { u32 hotkey_poll_active:1; u32 has_adaptive_kbd:1; u32 kbd_lang:1; - u32 trackpoint_doubletap:1; + u32 trackpoint_doubletap_enable:1;struct quirk_entry *quirks; } tp_features;
@@ -3018,6 +3018,31 @@ static const struct attribute_group adaptive_kbd_attr_group = { .attrs = adaptive_kbd_attributes, }; +/* sysfs doubletap enable --------------------------------------------- */ +static ssize_t doubletap_enable_show (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sysfs_emit (buf,"%d\n" , tp_features.trackpoint_doubletap_enable); +} + +static ssize_t doubletap_enable_store (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t count) +{ +bool enable; +int err; + + err =kstrtobool (buf, &enable); +if (err) +return err; + + tp_features.trackpoint_doubletap_enable = enable; +return count; +} + +static DEVICE_ATTR_RW (doubletap_enable); +/* --------------------------------------------------------------------- */ static struct attribute *hotkey_attributes[] = {
@@ -3032,6 +3057,7 @@ static struct attribute *hotkey_attributes[] = { &dev_attr_hotkey_recommended_mask.attr, &dev_attr_hotkey_tablet_mode.attr, &dev_attr_hotkey_radio_sw.attr, + &dev_attr_doubletap_enable.attr, #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL &dev_attr_hotkey_source_mask.attr, &dev_attr_hotkey_poll_freq.attr,
@@ -3557,8 +3583,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)hotkey_poll_setup_safe (true); -/* Enable doubletap by default */ - tp_features.trackpoint_doubletap =1 ; +/* Enable TrackPoint doubletap event reporting by default. */ + tp_features.trackpoint_doubletap_enable =1 ;return 0 ; }
@@ -3863,9 +3889,9 @@ static bool hotkey_notify_8xxx(const u32 hkey, bool *send_acpi_ev) {switch (hkey) {case TP_HKEY_EV_TRACK_DOUBLETAP : -if (tp_features.trackpoint_doubletap) -tpacpi_input_send_key (hkey, send_acpi_ev); - +/* Only send event if doubletap is enabled */ +if (!tp_features.trackpoint_doubletap_enable) + *send_acpi_ev = false;return true;default :return false;
@@ -11285,7 +11311,9 @@ static bool tpacpi_driver_event(const unsigned int hkey_event)mutex_unlock (&tpacpi_inputdev_send_mutex);return true;case TP_HKEY_EV_DOUBLETAP_TOGGLE : - tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap; +/* Toggle kernel-level doubletap event filtering */ + tp_features.trackpoint_doubletap_enable = + !tp_features.trackpoint_doubletap_enable;return true;case TP_HKEY_EV_PROFILE_TOGGLE :case TP_HKEY_EV_PROFILE_TOGGLE2 :
Signature · 1 line
2.51.0
PATCH v5 3/3 Documentation: thinkpad-acpi - Document doubletap_enable attribute
In reply to Vishnu SankarDocument the doubletap_enable sysfs attribute for ThinkPad ACPI driver.
--- .../admin-guide/laptops/thinkpad-acpi.rst | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +20 -0
@@ -1521,6 +1521,26 @@ Currently 2 antenna types are supported as mentioned below: The property is read-only. If the platform doesn't have support the sysfs class is not created. +doubletap_enable +---------------- + +sysfs: doubletap_enable + +Controls whether TrackPoint doubletap events are filtered out. Doubletap is a +feature where quickly tapping the TrackPoint twice triggers a special function key event. + +The available commands are:: + + cat /sys/devices/platform/thinkpad_acpi/doubletap_enable + echo 1 | sudo tee /sys/devices/platform/thinkpad_acpi/doubletap_enable + echo 0 | sudo tee /sys/devices/platform/thinkpad_acpi/doubletap_enable + +Values: + * 1 - doubletap events are processed (default) + * 0 - doubletap events are filtered out (ignored) + + This setting can also be toggled via the Fn+doubletap hotkey. + Auxmac ------
Signature · 1 line
2.51.0
Re: [PATCH v5 3/3] Documentation: thinkpad-acpi - Document doubletap_enable attribute
Documentation/admin-guide/laptops/thinkpad-acpi.rst Currently 2 antenna types are supported as mentioned below: · line 1540
Quoted 3 lines · Vishnu Sankar
Documentation/admin-guide/laptops/thinkpad-acpi.rst +3
-0+Values: + * 1 - doubletap events are processed (default) + * 0 - doubletap events are filtered out (ignored)
Please separate the bullet list from "Values:" paragraph.
Thanks.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Re: [PATCH v5 3/3] Documentation: thinkpad-acpi - Document doubletap_enable attribute
Hi Bagas,
Thank you so much for the comments.
Quoted 7 lines · Bagas Sanjaya
Documentation/admin-guide/laptops/thinkpad-acpi.rst Currently 2 antenna types are supported as mentioned below: · line 1540
Quoted 3 lines · Vishnu Sankar
Documentation/admin-guide/laptops/thinkpad-acpi.rst +3
-0+Values: + * 1 - doubletap events are processed (default) + * 0 - doubletap events are filtered out (ignored)Please separate the bullet list from "Values:" paragraph.
Acked.
I will update this in my V6.
Quoted 5 lines
Thanks.
--
An old man doll... just what I always wanted! - Clara
Signature · 4 lines
Regards,
Vishnu Sankar
+817015150407 (Japan)Hi All,
I’m writing to kindly follow up on the patch series I have submitted.
I haven’t seen any review feedback yet, so I just wanted to check if it might have been missed in the queue. If there’s anything I should revise, test, or clarify, I’d be happy to provide it.
Thank you for your time, and sorry for the inconvenience.
Quoted 67 lines · Vishnu Sankar
This patch series adds support for TrackPoint doubletap with a clear and simple separation of responsibilities between drivers:
1. Firmware enablement (
trackpoint.c):
Automatically enables doubletap on capable hardware during device detection.2. User control (
thinkpad_acpi.c):
Provides a sysfs interface to enable or disable delivery of doubletap events to userspace.The approach follows the KISS principle:
- The TrackPoint driver enables hardware functionality by default.
- Thethinkpad_acpidriver controls whether ACPI doubletap events are delivered, using existing hotkey filtering infrastructure.
- No cross-driver APIs or dual filtering paths are introduced.Changes in v5:
- Rename sysfs attribute fromdoubletap_filtertodoubletap_enableto reflect actual behavior.
- Fix inverted logic so events are delivered only when doubletap is enabled.
- Suppress ACPI hotkey delivery instead of injecting or filtering input events.
- Register the sysfs attribute via hotkey_attributes[] instead ofdevice_create_file().
- Drop unnecessary helper wrappers and debug logging.
- Update Documentation to reflect the new naming and semantics.Changes in v4:
- Complete redesign based on reviewer feedback.
-trackpoint.c: Simplified to only enable doubletap by default.
-trackpoint.c: Removed all sysfs attributes and global variables.
-trackpoint.c: Uses firmware ID detection with deny list.
-thinkpad_acpi.c: Added sysfs interface for kernel-level event control.
-thinkpad_acpi.c: No cross-driver dependencies.
- Documentation: Updated to reflect simplified sysfs approach.Changes in v3:
- No changes.Changes in v2:
- Improved commit messages.
- Removed unnecessary comments and debug messages.
- Switched tostrstarts()usage.
- Simplified firmware capability detection logic.This version addresses the remaining review feedback by correcting the naming and logic inversion, aligning sysfs semantics with behavior, and fully integrating with existing
thinkpad_acpihotkey handling.Vishnu Sankar (3):
input: trackpoint - Enable doubletap by default on capable devices platform/x86:thinkpad_acpi: Add sysfs control for TrackPoint
double-tap
Documentation: thinkpad-acpi - Documentdoubletap_enableattribute.../admin-guide/laptops/thinkpad-acpi.rst | 20 ++++++++ drivers/input/mouse/trackpoint.c | 47 +++++++++++++++++++ drivers/input/mouse/trackpoint.h | 5 ++ drivers/platform/x86/lenovo/thinkpad_acpi.c | 42 ++++++++++++++--- 4 files changed, 107 insertions(+), 7 deletions(-)--
2.51.0
Signature · 4 lines
Regards,
Vishnu Sankar
+817015150407 (Japan)