From nobody Sat Feb 7 18:20:29 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.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 90BC2277017 for ; Fri, 26 Dec 2025 23:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793244; cv=none; b=WWvbO97cFUVlwTkhX/TK7u2A7uuPvs8LQaepX2fa7tEB9QFkABJ1OdZWl0oo/nH/x2+IBDTxax2+qgo9iBU3qkeIDL2dui06y4tpVNJ81sMCzuoSxNZTNIxcWNjyoxmCq3x+Cmxjyo5cJUhX3oSfprgMmT88o1C4Z3s6COloalc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793244; c=relaxed/simple; bh=Hrnazuahv2v9rpFCsMEJC0zgdKheqCVmhgytvsJwNK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZsS5Fh5g/K7YsaBuY7ibVcYK0OLnVAGsGxyAwAiNe6wKQ/4QoLSA45D1P+Bn9YQwZRJxKU4dVTqmv/Sb3u6zraAjkkUzWfu/jeJGAg33HEHRIE7f29jxRgX8YYfuTsf7WdTTaYZGKd6DlXstvd71Wks6XdaPeTmoA+eE6Rw+k1U= 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=GePis9lF; arc=none smtp.client-ip=209.85.210.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="GePis9lF" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7e1651ae0d5so5926810b3a.1 for ; Fri, 26 Dec 2025 15:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766793242; x=1767398042; 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=KMAB5C1zkD/DVWLKDv3RV0IL8z1Pp7D3kuyKzpTCHnM=; b=GePis9lF1yHS3bY/G6B2v56xmBrly5U9uR8aQpbIjN1lGqGIB3r+bA2em53PW3y+P2 hdzxsXz+R7/SlomPUwUcY4GBgNoHTGfX3rCkkjQJ0cev6icApLdw8sCM0Os5FQOnPCpO tztGn0VFz8QzA+gfqTuosMOBENkAA3O1NU/8cE9XOqNPhUFkx7yH/Dk2tiDz50a52ijb 1CU9BfqQ+O0ygVk4FUYQFiVfutd0PkYK92BA2Jhv3pXDAGpC85XZtiXAT5DnrQv+fQSB eW3371+7oNWmSapTff2t/3e5b9BJVivwdthE2P8BDmuKHczZlYj4YGGM/rRfh4wyAJhS +O/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766793242; x=1767398042; 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=KMAB5C1zkD/DVWLKDv3RV0IL8z1Pp7D3kuyKzpTCHnM=; b=PLERP9fczaggp20rR2ntFGbu60lNiT/hXlD1w2ed9/f4ng2WFPHR95cgXG4ew7UEIg /eIH9atOPrKvsml7DnB6TDhLwvemjgIsm1aDm7ktmurQdPFuL5De4qKBGZrOlBNbm1Qu kUxQrxqpF1dwfa65LkPzLes6rwET0MKjKgvD07e8BPqU7KmO2Q7q6Y2DFDOC4PkDvHlk FQxWP8NensfBXFM0290MxXUoxJL+m9c4jkuPZ/fSArpBMTzW8MqJT6cFgYrZwiYep00Q AwFqEvPjSW0Ly1dCDGCZSxJuOEPJqkfBkL0mPs17e2KCKhGGzSIkulGGICB8dP/7/iGC SwRg== X-Forwarded-Encrypted: i=1; AJvYcCVnJIsBYqIDjIR1V91ThTuSS31L7uVIUsd1abG+dUi1uEPWgIwbAGqzmQ462fhNKlZtv6Y9wpgqMJFRtKM=@vger.kernel.org X-Gm-Message-State: AOJu0YxdojNIsbF8awJWShYAhoQ5Za6wFrieis7iudq31zmS4EE3fORt CF8LOdixjakO3kaz/Yupj4arqCIyfVbOJ7N4Yx7/t8EuMS1JiOmgZduV X-Gm-Gg: AY/fxX5fc3F61q4zljRD1VDTeHpLrFLqe+nNbsjCoq0H4y0jCDzNduZfcVPxLClrIed rPXTzrU6ZtVsiPNptaYPFQ6oZYqanOG2RCFK7Vmq3NYh56a5ZZcEvEiEqcTppOcwtsAegob/GGn nQZGrwu9Pt+RgCAfBxZsshuyJG3Vv6BgxWEzbE9gwCpWQy60jTYatRarMR9P9uLi0rjjQCMmZLU j7yL0MUxgdYmYuvKi0EXeetKZU58AFTGWg9nAU7T7QCQREqb+qqF8px4zbEq0OjtKbEcMSr5p/w 6AlBIeC4f2T95OeMtchmS6eGoDScW8o9Al1VgeecZWGROmraCQuysGPWskw15WA5AaR7GnnZE5U 9b9xOYPrUoHqob/VcvdE4hotGPo/YCcPvJXgqA4Zh1+ByWWJCyPDZbGve2HMivjS/tuD32k6rdI FWD4BU1hK4BwGCPZ54JXNiY3lciuJeYjC0XttMWLhJqBnfpAysEHTYQ7JUFH//fy/w7Q== X-Google-Smtp-Source: AGHT+IE/jRVZWjbzqOMpIpqznB8AgsA/aJsvshwBSCcVXQGXPfun222sZyDCBMQFidKb3X3DLoILKg== X-Received: by 2002:a05:6a00:1ca2:b0:7f6:6011:b106 with SMTP id d2e1a72fcca58-7ff648e611emr22680938b3a.19.1766793241725; Fri, 26 Dec 2025 15:54:01 -0800 (PST) Received: from c12-ThinkPad-X1-Carbon-Gen-12 (softbank221049092147.bbtec.net. [221.49.92.147]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48cea1sm23395216b3a.45.2025.12.26.15.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Dec 2025 15:54:01 -0800 (PST) From: Vishnu Sankar To: dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, corbet@lwn.net, derekjohn.clark@gmail.com Cc: mpearson-lenovo@squebb.ca, linux-doc@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v5 1/3] input: trackpoint - Enable doubletap by default on capable devices Date: Sat, 27 Dec 2025 08:50:59 +0900 Message-ID: <20251226235101.106451-2-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251226235101.106451-1-vishnuocv@gmail.com> References: <20251226235101.106451-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 --- 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(+) diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpo= int.c index 5f6643b69a2c..8319b5bb6ce5 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -393,6 +393,45 @@ 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 +509,14 @@ int trackpoint_detect(struct psmouse *psmouse, bool se= t_properties) psmouse->vendor, firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); =20 + /* 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; } =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 Sat Feb 7 18:20:29 2026 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 11C9E27E05F for ; Fri, 26 Dec 2025 23:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793251; cv=none; b=u2PzsrrYdDu8DCEQcABI6FefbuommGumsiIK0S19xcod+B9OhkGXlHqS19zYLA8HiIUdt8tkx623khGWbf2f1stUIf7R/PTj1kkGI0yN9IQP/S9unQ9T8G99t555r6JOz2TnWWDXvZH4ejLWFr6LKsYtWMm02OKAE5tikQjYxyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793251; c=relaxed/simple; bh=EHO8zs+g1Ko8UHjpjUG4wCs7CJMj3UxzMt+d6rQqm7c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g1OzKpu3Gc6NBxLH3uv88RsRwHQPALIO9HiV3kWKZpfr+6oHAb5PMWhJ6ptqBmPMZufHXpcPwrD7V61Udyj1eoPg3DzKU/n39J5s+rHHzKeBPNJcJbZn5VSrXIp2jTwKpI36rrMemTD5BH5LvupS3JsCmHILSRlSRgnaeWXmpsI= 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=j6lzhDdf; arc=none smtp.client-ip=209.85.210.170 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="j6lzhDdf" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-7f0da2dfeaeso7950553b3a.1 for ; Fri, 26 Dec 2025 15:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766793248; x=1767398048; 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=w5DU1y+/2ttdbcr+v/9sCW2fX8t95H3Z19WR35X2oK4=; b=j6lzhDdfGg1c3OQzxctuT0XS6lBZ7dk6RD6hCvaNbTmGB0a/FhEPY7/5kg4LsIIIUG ja7L+RBCw28iP2l8h3XrBFYD3RkkhJndl4F4j4JJXMt0qURBX3Oc7pAYADJYJQ0jM+xh ZW3/57S+SMa02uGMsCQ6iNTbNw4klpZgsaDGOchrko6ySpqT5E6zkzrEtcEFGCcLxE39 26YVl2vbYF98ZEipxPU2YESSVOVhn+Rojptk94jStkN/Zkh2aoU+vmuFbFv6PgF5ZWm2 MebYRFAqE63YKo9lkUl6CZaYFHy2pmL7FrkzKFBcgNND/x1rmB7FcVVE2P7tc5WnbxVp pTNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766793248; x=1767398048; 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=w5DU1y+/2ttdbcr+v/9sCW2fX8t95H3Z19WR35X2oK4=; b=nibaZ5m4cm4LsLj4SLbws66hKtei8+WHTpzsbuSXxwYexDj+p4KZwlkkBvJwJ+WfGm lxpdqLH0pq6+0FbMV8Dk/lo8dmuScDCHgMN91WszkeMM5QHbVCN4XXTrO40lJlPCKQ+I KpCfilYnpyeHXvCMzgIr5MYdMcwvYXm3IoF/UyuIx6vkUeSc3BtdQenSPWQnNlehxRw7 2Om0Dcb3oD5jUHIDrzLNDnVd2H8lSDs6ZxzoDKkBJ4gd6DwGtTGhiLtp1v2z7xaBJx5R cED2JbqIdm1bLRZRmo+R59funaARtuQE/mBRISJav+LKPmB/U1ibxJSQJxI2Fa4PVVKT WqqQ== X-Forwarded-Encrypted: i=1; AJvYcCVosJ9wyD0Rm7mO7q1YbPVz5AJBf2NI4Ry68S9M0txhJzBiKuqpRWtp02LjOgSVNgVlNSPPCmgCUZrCwiM=@vger.kernel.org X-Gm-Message-State: AOJu0YxxlWbzAcfWIrW0TM4FqILCZzGzCbTcTjVhEFcAfvntOTUzRr7o sAPrqI1E6mPDUQIdk6arRNDKIghd9ncsRnBQa4OiTMrr7oiFa8ymF9Mp X-Gm-Gg: AY/fxX6jdAGElo7BcX2VhCYgH05YY+tvqUF28aImMNLJbc3Ugh+C4jr17ER6U4ceoqK XEA19N745MHQrqcyqxYWrZChZhjS/Zyy8LK9+YSBbHRFXvw2DqynS9LDLjWzX213SfTZ2rbisxs 1qe2bXP+XHKFpl4tbe1BmsAYCTztWoOAZXBJnVSip0MoMmuIIFPlWdTjXxaqCtVYbQ/WdOK+pPP h4OMfSKlG31R5X8NsnwNo2ygCfqqY1mwawoonveou8z06YzboMo3KetxdCIp8QyxyVpjfsvZtJH +p0tZFVa9DKQUk9JeBhmXkEoY4j+ahJ6CatnYpCq9Ax8J+5jXXv8rF8HjKaPWTEtD7FXjdvAG1j BQmmC5h0O1T/JdbKX8A484nLVQD3zFx5XMEeURiNGRLuLe8ZKZbs3jLfQZlm8tF09Z7u0VVda8h 4z3su+OVV93gbB23ZiIoOkTZsDU9qrszcQFAoXCsLU6N4qfBbEN3UTgTkF43M1AJrk4w== X-Google-Smtp-Source: AGHT+IGHZNdiYUAkHVfUtkTTfJbCMz+mzs2nqIy6hLh/pD7Fj59xEYPwd2APipEMKlpWGct6gJgcbA== X-Received: by 2002:a05:6a20:12c9:b0:34e:e0ba:7ab with SMTP id adf61e73a8af0-376aa4fc463mr26589388637.40.1766793248246; Fri, 26 Dec 2025 15:54:08 -0800 (PST) Received: from c12-ThinkPad-X1-Carbon-Gen-12 (softbank221049092147.bbtec.net. [221.49.92.147]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48cea1sm23395216b3a.45.2025.12.26.15.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Dec 2025 15:54:07 -0800 (PST) From: Vishnu Sankar To: dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, corbet@lwn.net, derekjohn.clark@gmail.com Cc: mpearson-lenovo@squebb.ca, linux-doc@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v5 2/3] platform/x86: thinkpad_acpi: Add sysfs control for TrackPoint double-tap Date: Sat, 27 Dec 2025 08:51:00 +0900 Message-ID: <20251226235101.106451-3-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251226235101.106451-1-vishnuocv@gmail.com> References: <20251226235101.106451-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 cc19fe520ea9..ca01323c990a 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -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; =20 @@ -3018,6 +3018,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 { @@ -3032,6 +3057,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, @@ -3557,8 +3583,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; } @@ -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 =3D 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 =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 Sat Feb 7 18:20:29 2026 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) (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 44BD52B2DA for ; Fri, 26 Dec 2025 23:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793269; cv=none; b=ZLJDvjzBjL12EnRRjLQ5qAThHp3XoBodIMgO/A5PpeWlbjuA2mXszdlCk3lf5hNnaNok59GARdqbGgkVMEu/IsPLQQxoP+Zyf9jd5sPjYRrcUCQ1KHiNJ2MxZB7zvQXJlWco+TYRS/Yosr/Od5BF4+XictBpWN8ne6duWStFyfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766793269; c=relaxed/simple; bh=1SdlCZOHH1KcWWYXNTcQtIYihCh8YljUkPPX7+T+Z3k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RvNkyHtVhkXnYSVoG50RTSs7R0xEsrUaO0S70SfygMGlyZ2oeHkDc0n4t5QH9JLS4DoKOzHBEgi1mmIPbUKAJZ3grV35VIHoa1aiUE2+IWhbIhQs9uBfnTuhnj8hXq3gkzaY2A7R2I8Ntw41qz8B6HWUvVQZhwNhMg/+Jl67xbQ= 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=agvX5hlA; arc=none smtp.client-ip=209.85.210.193 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="agvX5hlA" Received: by mail-pf1-f193.google.com with SMTP id d2e1a72fcca58-7b9387df58cso12233038b3a.3 for ; Fri, 26 Dec 2025 15:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766793267; x=1767398067; 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=7rRrf9jdBX343iQYo4lj0lM0On8e8PTdq9pmhf6wv5Y=; b=agvX5hlAeWVZM/7fqir6cRmeDDiMVL0FX2QPCOXzpddMtpXUcQ76gIWOInWEoW681/ HBzIX9riWfjLnzhgJ93RPcKSP+J/KJik+y6rPtXHXqhgZl5tchJos0dSLr9giAdCtu/8 fT0pVRp4MrF1PTj3vEiJusCI4NPV6dwiPcHFJeOeqWHEB7f3slg7u+2NZN3AHM/892va My5zq0Shdzr8rJvO7ligK8U911+3IHVYGG0nawzDcQ1dC+Tp9n+2vpbEjOEwHaboqPQc TmJ9cv+w5WujcYl/cH8NpoZg+WD3G4vZbOHJdBcFGHDOlGBCA7aixlBitbBtp6MbOfQ1 uiCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766793267; x=1767398067; 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=7rRrf9jdBX343iQYo4lj0lM0On8e8PTdq9pmhf6wv5Y=; b=P/bU6TvVI5oMZK0QgNr0egFaZrXQN3utzkUHWzNXimV9XXm+e0N/EnM4nEwPI/ktUB ivPeBi8sfpjZ0D6ieLTyInfj71E/vD5NrJc+k3M/Z9buAeQU+ybA4k7yPTUpas9/iTp4 6qQYWwKtVpEpftx2E71dl6MOQURtm9VqIWitrw2vqZPH3Id2ZvH4sGSaNsA4LjwW17gN kOO3nLQC2or8MYpwglH/H1dTpIU3ofrYBP96BwU0vRTkCrWc6QPHvmkebErtsO9udXvA Le41f0VFUYJJVIlDlKUnk0QV1qoLzoqyZ/tQtj72yfsvKi6fmMZ9HayMYVl/hzMBvSbK kQ4Q== X-Forwarded-Encrypted: i=1; AJvYcCUgqeRqbOvbSACGt2zIA/98PFez8/furQBrUz3BTmACsJKT2SwxqrtqXp2i+oznDp0EVwAKi1ghxVIEuLE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw79sBo2U+OTh5WsqIxruaGWLiqWMtXWTSvv2YNJgMA5QptuGtH 0zGoZGt1VmuPc/hVxeg2F1FdM3d00Pi2ua6GgFsFWF0yFXQeB+2M8Cbg X-Gm-Gg: AY/fxX4JyE99eVoR7epDUj3ePmsM+Dv9b5f8/+cXugROt5papUqCMz14dw3gIpg+Y3r m1EeJkRTenuY4AMD+ZL1pPdCEvbBe2y6y3k7trsyF29dlY9mtR6VUYGEXViJVA0N9UKe5WWCdXS xprhZwiiPpAdbKFqOmxy0a8mfGZWePWvHEfmyD9k2NBzPXPO7u+F2K9KC+6rLo8iDlFzryCJLx8 TgNMkOI3oqlwPkIe6BhoUx4pYV8tB5SMCer4lDM5Hyk+R8yPEYJgeHQ/AP0FBzNay25t/ag4mdN gyxbBYkRsYJtwoHU9t0aQI7ngLseXhjTJAdY+9zRbL2LtPSSDvxrVNkyifCT4sr9/XiE6guM5EB ewmJnqj3a/6hPi9o9OBBh5dr3+pQyblzN/Cu4LvbdV0tQD4CsopSuT4XnLXr1iQ6T3QIw9Bp70E TZN87GWCRRNM9adM3Xuxx54YAqSfPdYzM/Xc8STAiuU5wKoz3Ha3t8X+q1kPO2rwXQZ2zHhiRQ4 OQH X-Google-Smtp-Source: AGHT+IGuFiGBjFMS9oYCwzOarwUo5Emq3cwg6KxdhIJ3EU9w1ec9sB8aCPtiMnCJKi13ZbL4mqZLuQ== X-Received: by 2002:a05:6a00:8014:b0:7aa:e5f2:617d with SMTP id d2e1a72fcca58-7ff651c3519mr23692817b3a.30.1766793267546; Fri, 26 Dec 2025 15:54:27 -0800 (PST) Received: from c12-ThinkPad-X1-Carbon-Gen-12 (softbank221049092147.bbtec.net. [221.49.92.147]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48cea1sm23395216b3a.45.2025.12.26.15.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Dec 2025 15:54:27 -0800 (PST) From: Vishnu Sankar To: dmitry.torokhov@gmail.com, hmh@hmh.eng.br, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, corbet@lwn.net, derekjohn.clark@gmail.com Cc: mpearson-lenovo@squebb.ca, linux-doc@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, vsankar@lenovo.com, Vishnu Sankar Subject: [PATCH v5 3/3] Documentation: thinkpad-acpi - Document doubletap_enable attribute Date: Sat, 27 Dec 2025 08:51:01 +0900 Message-ID: <20251226235101.106451-4-vishnuocv@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251226235101.106451-1-vishnuocv@gmail.com> References: <20251226235101.106451-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 --- .../admin-guide/laptops/thinkpad-acpi.rst | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst b/Document= ation/admin-guide/laptops/thinkpad-acpi.rst index 4ab0fef7d440..23bc84b0475d 100644 --- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst +++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst @@ -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. =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