From nobody Thu Apr 2 09:33:20 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 853E63C7E01 for ; Wed, 11 Mar 2026 14:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239695; cv=none; b=Lxs8HoOXnmuB5qhaI+XfZub4hc5lgLd5Uu6e6tPSYVyUXt69GXIMEzLyM+W6urWCahLyYjxlCPHCNMlKCfLJ0rmiYNGVnJD8DvGsRNZ1FZX67IWxPwlkg3c3xhOfpC+iIj3EkQJtMOUeDma81+VgR/F4m/V/naMb31qyPO1iDsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239695; c=relaxed/simple; bh=27fpxFp7lB53jWFCOatArqKjpJFcS/bB5xSGstlmF3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GqYGSjahTqA8ayvabycn/ZpOlHlc+1RMAXbhcPOFsYnWUj6pMWlgGy9AONloBhOTq/dStBUu+TVzjuSqSKf2TijizMOB+25DXmQWEoNH7NO8b7loaob0DvGoJ1vqpUMKDC/R1xmNhEBz8YcmNQx4CJI5QqlxH92KQ3ChqFHUB4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AgIoq2/e; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AgIoq2/e" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-c70ea5e9e9dso5396339a12.1 for ; Wed, 11 Mar 2026 07:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773239693; x=1773844493; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0oJSVhuIHw/FWlPKxzaQUmvjCJEQN/D5Xsb6jINz2Mc=; b=AgIoq2/eTslMvi2XbnVMTbohboI0dd/s1ISFGbP0vFm64kvfBmycsOSpY2doa+acEI gKFBK1ackDkpdQYCpGhn43HGP9g8xrQi+qyUSSdi5DmgK0SuyiZbq1gxuj8O96fGfK/9 1Ek6tjT3DptKD5ttBIVzKPNBNF5gwsyl5PH+DBBM336Zv+q7stm4z4CNa2TutO0hvD3v Oa9+kT4UBuEFpOEKNVDTB1td6E1N9TmDK3M13Dz+PxCIewI45U4/Cy17KX8bARQJIBbh RrGCse0xOs50GUGP97F9oLXgPjRW1peYnOBrGwlQmkIcPOVHwnZZXrf2jsXEDS1xYZrt I5Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773239693; x=1773844493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0oJSVhuIHw/FWlPKxzaQUmvjCJEQN/D5Xsb6jINz2Mc=; b=AZGDG9HU7GMGtakA2f3f/6xr/Si39HVnTnvEaQJppfbkYA0lrpW47M8xQY0kS46CL0 1PwSTCk/eGIQuTAdSJOOKhwRIYhvk1cqa71OqZqf6MZYYiYzcRmB5pbSTinLluxJrGql ICz+zyFvwAl2BLeeUXSQ/9w6ZVZKkBb7tv66kVuT5UbkS0CvExBCiRNd992BWvKUsLeq V1JceVOjn8iS1/MGkuz0A6iF/Oi7YBGblc3D5HcU8qoyXapRvQPqSJIKdoVF/zqK6KvX dgt4lUtaZ6821bwjHGzEXwqwFroEFNMHeqZuFeQOYz47DMvALRT7F4YuTNuEqs/i+6uK lTTQ== X-Forwarded-Encrypted: i=1; AJvYcCXuVZSDv7LW9qYyOcXbGVwGJGq3rWFrHgevJSyuFnuPkzfGakltUceNsxsapGEcKgKqQSkfRlKnU5FkT4A=@vger.kernel.org X-Gm-Message-State: AOJu0YyySoT0C2oezRthpKI/q/VOJpqgx4LbfWRWIbqab/AZDJhJHLrD EMZCS2+OSxJtQcIHfWThrfQAmwqAefBydaWdovPDQw56M73LQUPSZZYV X-Gm-Gg: ATEYQzxKD4uaidLKL5eqlXj4/xg/127JiIG9ZkIRqrbXIR1nkJz1lWWnRKHpKdH44LZ 0rvzyM1j8sKZfpNV1u8I95d4+6GfGpsMk+zcHHwJ/6ZgKgwAYWSzxTcDKp7ZDrRoVFvpG7Vmwo7 3DLeXA7h1s4vO3z2X7l0IGGgfZPP6NbH8avGuLGpVfVFtzZINYUhxMBW69EYod9gqWbpkylTJk8 cv1xS7gPd/+KbP6I8StPN4DOjpiw62qYQkl9zOYmi9uvQGGx66KjIgmUdUg287gZ6A8BmS2aO0i d9oI0hS6jXlpkM5uyeyLjio2RvOwHy1NV9hi840/6jCxatSqT+pzn8+Wga0P8U+FGy5axVhJSpt HF63n8582HKvTV3pRu/otS50wBPh+Ie3E3s9MxrMDMYrBPZrldLT5K/dGjOzgdc43P9BneXy7v4 R74mRT0/MOLX0rUtyVXWttxFt2+K0dx0Ot0kFbXVpSuiOu3eYO X-Received: by 2002:a17:903:288:b0:2ae:825b:49a5 with SMTP id d9443c01a7336-2aeae65e49amr29551425ad.0.1773239692701; Wed, 11 Mar 2026 07:34:52 -0700 (PDT) Received: from c12-ThinkPad-X1-Carbon-Gen-12 ([2400:2410:5f2b:700:dd5:d7ff:1c94:3624]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aeae34e070sm26399235ad.48.2026.03.11.07.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 07:34:51 -0700 (PDT) From: Vishnu Sankar To: mpearson-lenovo@squebb.ca, dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, corbet@lwn.net, derekjohn.clark@gmail.com, ilpo.jarvinen@linux.intel.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v8 1/3] input: trackpoint - Enable doubletap by default on capable devices Date: Wed, 11 Mar 2026 23:31:42 +0900 Message-ID: <20260311143144.482145-2-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311143144.482145-1-vishnuocv@gmail.com> References: <20260311143144.482145-1-vishnuocv@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Vishnu Sankar Suggested-by: Mark Pearson Acked-by: Dmitry Torokhov --- Changes in v8: - Added missing includes (strings.h and array_size.h) - Better formatting Changes in v7: - Removed unwanted comments - Removed psmouse_info () Changes in v6: - No Changes 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 | 46 ++++++++++++++++++++++++++++++++ drivers/input/mouse/trackpoint.h | 5 ++++ 2 files changed, 51 insertions(+) diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpo= int.c index b06c7ad721fe..3bd8fdf56cd3 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -5,6 +5,7 @@ * Trademarks are the property of their respective owners. */ =20 +#include #include #include #include @@ -12,6 +13,7 @@ #include #include #include +#include #include #include "psmouse.h" #include "trackpoint.h" @@ -393,6 +395,44 @@ static int trackpoint_reconnect(struct psmouse *psmous= e) return 0; } =20 +/* List of known incapable device PNP IDs */ +static const char * const dt_incompatible_devices[] =3D { + "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 =3D 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 =3D &psmouse->ps2dev; @@ -470,6 +510,12 @@ int trackpoint_detect(struct psmouse *psmouse, bool se= t_properties) psmouse->vendor, firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); =20 + if (trackpoint_is_dt_capable(ps2dev->serio->firmware_id)) { + error =3D trackpoint_write(ps2dev, TP_DOUBLETAP, TP_DOUBLETAP_ENABLE); + if (error) + psmouse_warn(psmouse, "Failed to enable doubletap: %d\n", error); + } + return 0; } =20 diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpo= int.h index eb5412904fe0..3e03cdb39449 100644 --- a/drivers/input/mouse/trackpoint.h +++ b/drivers/input/mouse/trackpoint.h @@ -69,6 +69,8 @@ /* (how hard it is to drag */ /* with Z-axis pressed) */ =20 +#define TP_DOUBLETAP 0x58 /* TrackPoint doubletap register */ + #define TP_MINDRAG 0x59 /* Minimum amount of force needed */ /* to trigger dragging */ =20 @@ -110,6 +112,9 @@ external device will be forced to 1 */ #define TP_MASK_EXT_TAG 0x04 =20 +/* Doubletap register values */ +#define TP_DOUBLETAP_ENABLE 0xFF /* Enable value */ +#define TP_DOUBLETAP_DISABLE 0xFE /* Disable value */ =20 /* Power on Self Test Results */ #define TP_POR_SUCCESS 0x3B --=20 2.51.0 From nobody Thu Apr 2 09:33:20 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F4F83BC68A for ; Wed, 11 Mar 2026 14:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239699; cv=none; b=d/p0qPpUOtw0PEFdiN8vlPZW8YqkH3Bal2W/V6HvUbsLqSYPYJLy0SRGvLmTMGDBb9iTcHm0ookM3IH+8+pwNxJg9yo3L8b8D8qqlqz2xSepgZRwbLOMi8CQjOr+6xRPw3ZfbZsfmbexhRxJZmEFlp/ZgmiWTb4TPfIJqrC3WcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239699; c=relaxed/simple; bh=d1xZD8e5Zqlnnzv4l445DCWZ0qjTsvPnU+oHWRTh8oM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=edq4K/t0ecFfauidF0iI6awce02dhPP6vHwaYX4H1cEnh3WOSkBhXYgGjiOsKnDT/VY/sj8jFeKiE8tbHx+phN5ErSNUbLCxoaPLPe6EtUoVU+P8CPpjckxG7ESOSTOkRMku/0aGlCLiobkiJOn/oSL+EdQYf/Ss57bqw8Yb9P4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=P9mBn6w8; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P9mBn6w8" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2ae4d919f9bso97805ad.0 for ; Wed, 11 Mar 2026 07:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773239698; x=1773844498; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YKn1lwhpqGitdeQ8yVxMlCmzH3bk1uwW/OQclThoMHA=; b=P9mBn6w8gn6segdRsEtfuG8I7x9EDCcCTGOTZLSn5K8RgHsO4y/nqzxXlJrObbV585 zXjBpkKTG3bUL8gLnStaT6F1bv0Ow4lzyL2VSqTkt4DOJkbkqMnqJWDKNtSmdVVhidVb s9ZsI/8OK4dK5SyzeBLV3seiWHa+Lg3g+AF40JCv1BQz02DQJjfYT/bLwBqo/aGudx1N tXOuPwMMC4lEhIVTEzDTCkTZr87+GghNoaX1nw7UbNu6C6BgbwGUDX5YltgCkQauiber UDFh0d47d3bhdhC++cuhroe7pZcl917FgntTCknrmhdEPFyTBQQfc6C4iM7qq0QZtkBZ fdJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773239698; x=1773844498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YKn1lwhpqGitdeQ8yVxMlCmzH3bk1uwW/OQclThoMHA=; b=NwLfDD34dwZul1V8OoaWtg0j9epCeM1QqaYllEl5uJ7S4DbHsGJhUB06iLBJ4zBlea LE9F8rtwsQJKbpFMNZD6fowBZxLOVuPCVarqSAWD0KsuM7AB3OGSIlwzkfcksHcmLkTQ Qf739JPBFYa9VxsK5CRo7tMv9obhmcn1F4W6mZiFpFvVz1QBq2gleju75x+tIW9RyPWm uKfOYYwcRGtPsxfZqRY9m0Mv8dEU3ZdQd4no64yfcc5E3otxTbD8Fq+E5+NFArFnA6lF /UwZtpnYlGnVkNSHA9BrKsXdB6/Xl1hr4TWxSi8klzVi7dZldM0lCPHfHTx2vlft4qyK 1f0Q== X-Forwarded-Encrypted: i=1; AJvYcCUwawTZzEw1vDVSi5i3biqR7eTwcVTGf9AKRutp3gd8o11DHAv/mYqLn4V9tNQwbtTk1Obe6bVu+4WbFok=@vger.kernel.org X-Gm-Message-State: AOJu0YwHbjTUbHyboed9hsz1XRQtpKdk/8Pna4quif07KXBk1kfs0n4n R0lF2b88X1jgU/DtRQC0nWU/vvmduI3eY8ssb22yiH92GW9ABNv5gpxT X-Gm-Gg: ATEYQzywmCYY6zcQtUNldsZeyhvbWksY7NmouXjBb5W2vEftjN1hqfmQemmdUqMhUJx +Vd9f6XattGCEJl4kdbW9uVcPThFQ/ETJRH8OyiGqS57WUd7zuXYaIidLRaoaPqFxl5Bk4jetGL 3Ywd6Y9G3Vo+Jx3LQ5EYPDm0NM3Z0Rf0SUlvDvHjDQ+2OU3d4let4wDyFBfDPvSnt+bMWYlCNic w6VEvWj1LagCjKLbdRPta7iuq67Av2HQpYRocQ5B/aLJ6o11CBOGhL6Wp7ycJTwUs8Lris43nXq 1jZfBkOnezFWn3BT/V3NLIsYf9nEjf5QFfDjCmrzA0cASEZXeHjVePnbm8QoNTC40bcReilFPbG YxKob30hUeB+Wr8t7m9pn7cDeUFHQG/ge/BZwSQF79B+JjQMyhj8lsquLYiOKbFV//sGY2oCWJH W6tt/2zEJvkzajs9t7qJ2jWru9uI+0P+i0C0z34lXX66Ybc9jg X-Received: by 2002:a17:903:2446:b0:2a0:8be7:e3d7 with SMTP id d9443c01a7336-2aeae9179f5mr30006615ad.57.1773239697690; Wed, 11 Mar 2026 07:34:57 -0700 (PDT) Received: from c12-ThinkPad-X1-Carbon-Gen-12 ([2400:2410:5f2b:700:dd5:d7ff:1c94:3624]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aeae34e070sm26399235ad.48.2026.03.11.07.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 07:34:57 -0700 (PDT) From: Vishnu Sankar To: mpearson-lenovo@squebb.ca, dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, corbet@lwn.net, derekjohn.clark@gmail.com, ilpo.jarvinen@linux.intel.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v8 2/3] platform/x86: thinkpad_acpi: Add sysfs control for TrackPoint double-tap Date: Wed, 11 Mar 2026 23:31:43 +0900 Message-ID: <20260311143144.482145-3-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311143144.482145-1-vishnuocv@gmail.com> References: <20260311143144.482145-1-vishnuocv@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add 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. Signed-off-by: Vishnu Sankar Suggested-by: Mark Pearson --- 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=3Dprocess events, 1=3Dfilter 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(-) diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform= /x86/lenovo/thinkpad_acpi.c index 8982d92dfd97..1b29f1067d8f 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -374,7 +374,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; =20 @@ -3019,6 +3019,31 @@ static const struct attribute_group adaptive_kbd_att= r_group =3D { .attrs =3D adaptive_kbd_attributes, }; =20 +/* 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 =3D kstrtobool(buf, &enable); + if (err) + return err; + + tp_features.trackpoint_doubletap_enable =3D enable; + return count; +} + +static DEVICE_ATTR_RW(doubletap_enable); + /* --------------------------------------------------------------------- */ =20 static struct attribute *hotkey_attributes[] =3D { @@ -3033,6 +3058,7 @@ static struct attribute *hotkey_attributes[] =3D { &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, @@ -3558,8 +3584,8 @@ static int __init hotkey_init(struct ibm_init_struct = *iibm) =20 hotkey_poll_setup_safe(true); =20 - /* Enable doubletap by default */ - tp_features.trackpoint_doubletap =3D 1; + /* Enable TrackPoint doubletap event reporting by default. */ + tp_features.trackpoint_doubletap_enable =3D 1; =20 return 0; } @@ -3864,9 +3890,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 =3D false; return true; default: return false; @@ -11488,7 +11514,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 =3D !tp_features.trackpoint_doubletap; + /* Toggle kernel-level doubletap event filtering */ + tp_features.trackpoint_doubletap_enable =3D + !tp_features.trackpoint_doubletap_enable; return true; case TP_HKEY_EV_PROFILE_TOGGLE: case TP_HKEY_EV_PROFILE_TOGGLE2: --=20 2.51.0 From nobody Thu Apr 2 09:33:20 2026 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 945973B637F for ; Wed, 11 Mar 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239706; cv=none; b=CFlMC75PciruzMLPom8pbeBQolWhMQjMgxSoCnX71aYcaRzEsm6Gebv3szHPiwkCB1Um/rxd7G56or1THrtdU/86u+5v4/AF50OYrzFSmnDZIFTzqygx9Wk+aOWtiJSJ3QLbavXQ9OOAD+U9QzzriftM8TMgerxwISoULeKRgLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239706; c=relaxed/simple; bh=i2XhmUiYnFer9xzDmhFquJehlBBmC6H0pTBvtA42ATw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HGxvwx5ft+Vr2Ec3FNrz9l4eNU4ioZuu5VaxnJz7+Y5JS+5Ep11e+oYHpMdEtHXPGyFbEI5XutPZNTIH46khro0tVH1PSBVSHwIhznzN/cNtVqrWFcT0TRi1ifvrb7gdwywLt/bA8hhS0lp/QvDU4LHyL+EC4UkE4gVBa8XBGrM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bd0WzJfU; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bd0WzJfU" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2aae146b604so99947325ad.3 for ; Wed, 11 Mar 2026 07:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773239703; x=1773844503; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ha4kqWoqYsblto5PQkRWralkYomP/+jWSwYzX2+nEmg=; b=bd0WzJfU2YhgV/2QtHlDLHeJxmJKHuWmrW6vO3qt0i9/PQVdOaJaw90O3ufkWnWSCw 452DraZfM+bPkqN/dn4N7C3dU33ZbarYrEeTb1mYgOmcYQkgYz5hbGN59+Hn9ZEMPf76 eLNKVP2bDvKIwhWtW1UWkSlWOnh5kC53S5S1k6t/1l/oycoRrBIl7yavw+hSfevv0NSH ALuKPxkG1D+2S85MGA+gWQ3yHGmq5Soi4PkcDnSmDLAEPLH3zWDeW9y0z9VSyeAFhDVT EhIOBiqVa8R02IlJcrwXasJDlONIe9lURmtHEucdIEL5OmHrHwQxfEYi12wJnVQcEKd/ z9jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773239703; x=1773844503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ha4kqWoqYsblto5PQkRWralkYomP/+jWSwYzX2+nEmg=; b=cWweNy79++JT3NGNYpFz9It9IHR3M767VT+YaqpIf5FkDQzjtSN3JCJFf9ltycsBdR qbTrrsWb/tp4FUyRch5lloZNmaKHGXlSsRe8n+sgEgVk6+VjnMB8/Mre/D63xewrLgxS tPfv5yObT8bnBpcBy8bJVGdTf5D53YUIXFa4rB/V9poEu3hMKAuimmQ2Bitu4RGJ+29j 7eGlaMbmntJccD0F7JKMnmBlXEarlp6mSokzeLq2ICzXMjuSlobs6dKmvUUEPpRZJ2kQ t9OK9oCsS8aYKa+pIzZ7LEY9tdngHrieYILeilrgphB0FfzRZ+SHHsrJO4VGXaynhLaZ l8oQ== X-Forwarded-Encrypted: i=1; AJvYcCXdWz2px4L21A76iyQ8Ow4xOulUvdwNWNyNmSjYEgOqlEVgiHArWpVsb1e/cbDafu9bAWt5Q2nkOKh0Xko=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+4vT6/HRjSG+p073N/01RTL7fcSJxD/jmaqVzQXXTkhBY5Fuz gNVVYKBgtlrNaCWN5MqZVrenm3HRK+Ei6Pxq35LGHmVur/J40kznxypT X-Gm-Gg: ATEYQzzrG8eQp80dS/33jMhGOg7wpiKD+44nk5Gh1YzojRtJ3DdCU+MLqpihLsWZ/N0 mZksaD7O0Yce7A+7WWK7gJ+CgP0X7V3LTOozwPiurFWQLkfMmKMGtJFtJQ7xF3dYpyRKt+WALqq 9U7NmOgaexZpjr/rhHi1/J1X8w+NGTYawAFWZndwCc7jaJIZ9FNp51RbIfFaUoq+6zeSGzonWyn tpp0S1GzFWE+XJwrzuGo/n8LhlcNv9cIw1K6Ua3rv9JP57RXCeeKEUBJXKrJK6hUD9zThXFV2KS 4r2V4ago0uRccyU7sFiuATFOVzIryM8Qf1SzoJFx7A/a56HbcH7WLDpCAz1QadP6H4zmVvesQbM VYcc4MAJDUCITNM8IhWm3C9pk9fqBuwerbH3fcTAhPAwfWMDlfp4WNGiRMLPBGyClKJpoUZ6VN+ Cgc0HZOi6Dz2LS75vVMJP6UDfgIKtsVWSbOcj9zkyV2I82UyXa X-Received: by 2002:a17:902:e744:b0:2ae:7f7e:93a8 with SMTP id d9443c01a7336-2aeae904128mr28551575ad.51.1773239702933; Wed, 11 Mar 2026 07:35:02 -0700 (PDT) Received: from c12-ThinkPad-X1-Carbon-Gen-12 ([2400:2410:5f2b:700:dd5:d7ff:1c94:3624]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aeae34e070sm26399235ad.48.2026.03.11.07.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 07:35:02 -0700 (PDT) From: Vishnu Sankar To: mpearson-lenovo@squebb.ca, dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, corbet@lwn.net, derekjohn.clark@gmail.com, ilpo.jarvinen@linux.intel.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v8 3/3] Documentation: thinkpad-acpi - Document doubletap_enable attribute Date: Wed, 11 Mar 2026 23:31:44 +0900 Message-ID: <20260311143144.482145-4-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311143144.482145-1-vishnuocv@gmail.com> References: <20260311143144.482145-1-vishnuocv@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document the doubletap_enable sysfs attribute for ThinkPad ACPI driver. Signed-off-by: Vishnu Sankar --- Changes in v8: - Fixes indentation Changes in v7: - Fix formatting Changes in v6: - Fix formatting of doubletap_enable sysfs documentation (separate Values l= ist) --- .../admin-guide/laptops/thinkpad-acpi.rst | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst b/Document= ation/admin-guide/laptops/thinkpad-acpi.rst index 03951ed6b628..f874db31801d 100644 --- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst +++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst @@ -1522,6 +1522,27 @@ 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. =20 +doubletap_enable +---------------- + +sysfs: doubletap_enable + +Controls whether TrackPoint doubletap events are filtered out. Doubletap i= s a +feature where quickly tapping the TrackPoint twice triggers a special func= tion key event. + +The available commands are:: + + cat /sys/devices/platform/thinkpad_acpi/doubletap_enable + echo 1 | sudo tee /sys/devices/platform/thinkpad_acpi/doub= letap_enable + echo 0 | sudo tee /sys/devices/platform/thinkpad_acpi/doub= letap_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 ------ =20 --=20 2.51.0