Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp784535lqb; Wed, 17 Apr 2024 10:32:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZ4ULE9KWyP4Myqpyn0fyPTQixXVqAPuo82LTkQlvwRduOds2vpzhAEt9/lJLbq2oDgKoxTxh+UjmCgun3LQozNFR7vZjeHA2BE/zQbw== X-Google-Smtp-Source: AGHT+IEziqe9py/M23karetegARsp3YT7ZjriPg96Cd/+KpAKehHxKE5kXDVl3hbNxB7b7AzRbOS X-Received: by 2002:a17:906:7b87:b0:a52:6e66:dca4 with SMTP id s7-20020a1709067b8700b00a526e66dca4mr149401ejo.32.1713375136269; Wed, 17 Apr 2024 10:32:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713375136; cv=pass; d=google.com; s=arc-20160816; b=qprxrFfKKXwGfSE1hVWqvka7TQNJ4r0Bc5odCNRlEW4G8tOgfHaesQaN8P2lsHaGuK Vz9kc+dy1mtwXTxMuWiiidQZKDa1MuZdWSeBzrVhV83cdgwrBbYIhEiBoL9sPwgoufAS AgpQondA4nSg/BBHu97wZf49HhW0toLB5ODl0dvbjRv6iwhxFlOIEOP4DR1SxdH5FxvA K84rxQDd72QI07OJ1m1P/KVg3Q4HYz1eucJPxkq/7pXZ7Pw+gEh+uvjmHVuKPk9Q8xhD lZsD8uJrLceKvFrIjHnPrxzCdL6BuKeIgdLaBWCgRyaM4qMpyzPBcpQTFndY0DDvXTgb 9/Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=2xm38a5d29dZKNzZ2Wg3DwnYmxWKLU185JCV5OG0sgI=; fh=xyLNkwHYL3TPPBLos4h5GUfOl7V0ZaTxR02iVhYnLmc=; b=i+ErUmPMvjlaSUA5ksCr/8PCkAV67SYNAgtAYhw/xND5GfyEOaJMsnuixTi+PQLU8l 2tRRnFsTggBQLiCO+QDWZQa0QOD3tq1PPiL0GfDvtrSJS/jN+3iL19tYuTPTf41s0B9g pTI6WxwFvSPYUfMbpNAl9R0otrQnpzZuUB/4FyK71LcUif85DiR+IsQx55jvfSm5ZP1S xWoZMPYFOuJN9PRWm+QlfMlG3fJCAw6J//dZcJNGEYranQZcs0Sr1JCZXXMkAU3iU80O kp574Vm7UKZZie0145rUDqzieiyJZShgeXE68Bzqnipl7dT1aD/OmSVTK+WnSxDGbydK 7SOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm3 header.b=as0sdHFX; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=C83JvOc+; arc=pass (i=1 spf=pass spfdomain=squebb.ca dkim=pass dkdomain=squebb.ca dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-148994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148994-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qc22-20020a170906d8b600b00a555a83ef3esi842473ejb.714.2024.04.17.10.32.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 10:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm3 header.b=as0sdHFX; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=C83JvOc+; arc=pass (i=1 spf=pass spfdomain=squebb.ca dkim=pass dkdomain=squebb.ca dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-148994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148994-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B13B51F253E1 for ; Wed, 17 Apr 2024 17:31:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B17B7172799; Wed, 17 Apr 2024 17:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="as0sdHFX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="C83JvOc+" Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93B21171673; Wed, 17 Apr 2024 17:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375098; cv=none; b=hCaLHyHj5bzzCl49yaTtdAniZ3kEG5kxck1bg/G1NHXxM/Bp7/QsL0VhCJmRfZN6kjcWE2qgkFKvgzME5EpHHYhdnQTOStcS2VM7XcrK/YTlGkWW9NKP8Hq7hN3XO0SLa876mnLGzzHfiQPN4XNyIKl4gAh9xgm317eFmu7fHxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375098; c=relaxed/simple; bh=fkvBrNWrW0X1rC3prWUWLNLQnJ8S0QdkFsVL3zsBHH0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NwkgvI+pUJh9RyyGdd8PQ3uMG3v6OkC79EaWG0ofkwa/zRSMXFnN2agpmgqdpyu4WCHm+cwJbf/v0SJDm3DeKwoNAD1+TIj+9qTSQ/d5S9Ck2WkrTP2qpdJWLWyj0hAFfXMGQ5NTjV7ABHwfvLp8c1tM/YR000Dj9X2euv0AnW4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=squebb.ca; spf=pass smtp.mailfrom=squebb.ca; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b=as0sdHFX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=C83JvOc+; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=squebb.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=squebb.ca Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 9FEB21380242; Wed, 17 Apr 2024 13:31:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 17 Apr 2024 13:31:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1713375095; x= 1713461495; bh=2xm38a5d29dZKNzZ2Wg3DwnYmxWKLU185JCV5OG0sgI=; b=a s0sdHFXSk1//Xe/ymQcGOG//3qTDCqZq6n7Fn8KPxgl5m7wNCTo47VTfclHzp6S+ 9jBkRPi0LmD4v5Nz9xugxDRmOdZLJBNJyo+RJ+YsQfAp41Ajgr+/1YQ2sTTp7EMh nwpbEzuT4nFKYCovAUSdZZFvR65SabEVj6FQjmOLAkGPSVLryIJw3DXK2ajDgPrF a2ZFtCqEZUALtI5U1KyrGHKoK/0EzmlfNw+DX73ioxGFaimn4t0saqrUge1IaXjf wPqiIDYsu+lUIV9YDahrt6cTkUpsLHomMhagjv85W/K9HvCwMiuYc087yWEZiycs cQYBPQdqQTjg1FLzktZcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1713375095; x= 1713461495; bh=2xm38a5d29dZKNzZ2Wg3DwnYmxWKLU185JCV5OG0sgI=; b=C 83JvOc+ls0LAnt5izS/eqKmJ4xTIpbHtD/woYFoLV4tvdNk8EfFBLWn1+B8UPZEW paSgnTKSQsZQwlw4AG6Ts0waBzjYzc88xZOKXgIm1Z3+D0yJIX7fINp2fdsTG6YY Lqp5yIwJ3UnS+2mpscjruC1o+h51ZJ9V2I5CcU2DtXFxlY3IoCv8iE7x7GM9GVyh erbTNRn8X2RLlPZ8/XJcYg6R/7GeCVlzQ/eY0MOzKWHKJsbhfx2IZYd59cvC1D3Z +K3BlYIci4Nat7kXyXOMJwwtO40xjirw7fAQLYyQhDGvAhel1qXKYoqvHrBnqv+E A9dl5OoKU+De5P7NEKJyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejkedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Apr 2024 13:31:34 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hmh@hmh.eng.br, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, vsankar@lenovo.com, peter.hutterer@redhat.com, Vishnu Sankar Subject: [PATCH v2 2/4] platform/x86: thinkpad_acpi: Support for trackpoint doubletap Date: Wed, 17 Apr 2024 13:31:07 -0400 Message-ID: <20240417173124.9953-2-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240417173124.9953-1-mpearson-lenovo@squebb.ca> References: <20240417173124.9953-1-mpearson-lenovo@squebb.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Lenovo trackpoints are adding the ability to generate a doubletap event. This handles the doubletap event and sends the KEY_PROG1 event to userspace. Signed-off-by: Mark Pearson Signed-off-by: Vishnu Sankar --- Changes in v2: - Use KEY_PROG1 instead of KEY_DOUBLETAP as input maintainer doesn't want new un-specific key codes added. - Add doubletap to hotkey scan code table and use existing hotkey functionality. - Tested using evtest, and then gnome settings to configure a custom shortcut to launch an application. drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 3b48d893280f..6d04d45e8d45 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -232,6 +232,9 @@ enum tpacpi_hkey_event_t { /* Misc */ TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ + + /* Misc2 */ + TP_HKEY_EV_TRACK_DOUBLETAP = 0x8036, /* trackpoint doubletap */ }; /**************************************************************************** @@ -1786,6 +1789,7 @@ enum { /* hot key scan codes (derived from ACPI DSDT) */ TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER, TP_ACPI_HOTKEYSCAN_PICKUP_PHONE, TP_ACPI_HOTKEYSCAN_HANGUP_PHONE, + TP_ACPI_HOTKEYSCAN_DOUBLETAP, /* Hotkey keymap size */ TPACPI_HOTKEY_MAP_LEN @@ -3336,6 +3340,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) KEY_NOTIFICATION_CENTER, /* Notification Center */ KEY_PICKUP_PHONE, /* Answer incoming call */ KEY_HANGUP_PHONE, /* Decline incoming call */ + KEY_PROG1, /* Trackpoint doubletap */ }, }; @@ -3996,6 +4001,15 @@ static bool hotkey_notify_6xxx(const u32 hkey, return true; } +static bool hotkey_notify_8xxx(const u32 hkey) +{ + if (hkey == TP_HKEY_EV_TRACK_DOUBLETAP) { + tpacpi_input_send_key(TP_ACPI_HOTKEYSCAN_DOUBLETAP); + return true; + } + return false; +} + static void hotkey_notify(struct ibm_struct *ibm, u32 event) { u32 hkey; @@ -4079,6 +4093,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) known_ev = true; } break; + case 8: + /* 0x8000-0x8FFF: misc2 */ + known_ev = hotkey_notify_8xxx(hkey); + break; } if (!known_ev) { pr_notice("unhandled HKEY event 0x%04x\n", hkey); -- 2.44.0