From patchwork Sun Mar 24 21:07:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13600924 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 7804A18638; Sun, 24 Mar 2024 21:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314519; cv=none; b=AGPYuoN6MQlZvRZ+1aoWUGXMtxWXza+mKZjbv6vkEyYWRc6EHZDqTv7bOhE/QzlKFEDzUXI1qCGYHraTCNW0+hPyEEIqTs3pkIasOjRu0a7no0sygILRHCd2VO/+oV2ZOjeI6CocpQjHqtCDqd8O92vToDsQEFp0N0jS1ANpjdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314519; c=relaxed/simple; bh=+9lyVLF+V8/ecFH+GFD1m49SSS72F78oQ4G9EqPglkU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cLE/jcCBG1fu0pz5/WhxadtVxXMpcjh2XoC1kWUyQqX6w5LIKVjlgAVTDRZX+YShpZV3STxvOPxZn7GKKBHNaLnZ9HIRef15NF2F5zlFEECyKjrPRoOUOyD+ToOSRmqyG263MJLO5Dk7hUfXRCFD1kUb/kcwmIgm2NwX2Rd2BYs= 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=tFtKub94; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=psCJmSte; arc=none smtp.client-ip=103.168.172.144 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="tFtKub94"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="psCJmSte" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 0FB9413800E1; Sun, 24 Mar 2024 17:08:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 24 Mar 2024 17:08:36 -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=1711314516; x= 1711400916; bh=IfP08NkGSU5kw3djwr6jz0i5FQEQ+nuYjW7asb0rxPA=; b=t FtKub94hR63Ps2KzHc0L757lTsZnpUWLbTmBqEYnH79JM5g8qjvO/yHF8T0pH/1k lOfpOrGSoQBBvpWrAuO9w7B5q9LNSlOcDhWwZLOizGuLHpgt0Q4zwoPqrTar44fR gfkCYcvayjPflC43CWrskcriZdkKJt4t+FSYPOR775O4yzSW9uVga4/neivwq7dH 10H+N9zH6Lsp7BOKvcHj5IzVcwzyEmX5pAvXqGAd/Zjx3ixLL7vfrBO8/TRti4DR /BRvUhiu9p5B1oJ/2t/JTmW+N4aNfWWbaFg5sUwTEuQTFXIGqbmbgK7TT+nGFtBF JO3TdYbTNO4n4ueB1csgQ== 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=fm2; t=1711314516; x= 1711400916; bh=IfP08NkGSU5kw3djwr6jz0i5FQEQ+nuYjW7asb0rxPA=; b=p sCJmSteQgyVdA2nkXKyySBt4gnMv3ILVFN3aKsj9eB8Y4cLhiAZBCiltZyw2fMe4 qtCknPhMErUOpc765FxpUBL0/uLtNlrNUoWuMp9xtYj9QalQHfUgO1SrgYCn5OtQ MDDqxkpe3zrQJkA7u1OjljuB4w1JeY5FKoo018DQlnDhyr+j4UlO4bHT3+IHywjb ZAAgB/P+CpAD2pixvMJo3nj9IU/N34DGvVT1wRTayc76o2N0LRhCm2Yt19fAUOE2 asOiOAOVKJJFnsmkWvyf/UipTVUEGdzmhL5gGnIt4BS5vSRQk3VqnRM1jae2bC3c Eh2vGZlHFNu2DAbWKnXcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtjedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Mar 2024 17:08:35 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hmh@hmh.eng.br, dmitry.torokhov@gmail.com, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, vsankar@lenovo.com, peter.hutterer@redhat.com Subject: [PATCH 1/4] Input: Add trackpoint doubletap and system debug info keycodes Date: Sun, 24 Mar 2024 17:07:58 -0400 Message-ID: <20240324210817.192033-2-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> References: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for new input events on Lenovo laptops that need exporting to user space. Lenovo trackpoints are adding the ability to generate a doubletap event. Add a new keycode to allow this to be used by userspace. Lenovo support is using FN+N with Windows to collect needed details for support cases. Add a keycode so that we'll be able to provide similar support on Linux. Suggested-by: Peter Hutterer Signed-off-by: Mark Pearson Signed-off-by: Nitin Joshi Signed-off-by: Vishnu Sankar Reviewed-by: Hans de Goede --- include/uapi/linux/input-event-codes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 03edf2ccdf6c..bd3baca95749 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -686,6 +686,8 @@ #define KEY_SIDEVU_SONAR 0x287 #define KEY_NAV_INFO 0x288 #define KEY_BRIGHTNESS_MENU 0x289 +#define KEY_DOUBLECLICK 0x28a +#define KEY_SYS_DEBUG_INFO 0x28b /* * Some keyboards have keys which do not have a defined meaning, these keys From patchwork Sun Mar 24 21:07:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13600925 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 ACE1C18659; Sun, 24 Mar 2024 21:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314519; cv=none; b=r/DEm3nhj2nZBLJYkZ3CE9nE8mfN5BCDpeqALvRpqcJ/ostFnlLI1Y2tNN2zmm9BUMSj2pdR7Rlg66W3p4jVnl2M5oqPTK+ySOHlgMddGNPHFV7b3YuPoEqgg9I6pOPlI/Ra4169KMe42cw7lfvwIHptEKfAwQVtg1e2xA9gLg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314519; c=relaxed/simple; bh=rifrElzx7wNZyg5yX40vRvlKTRB/AeUIbi3SjlZT/Zk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AC/Zq+Rvbw4CEBOCwFSBEe1eXFvj7WUnhCZkL4Ws3+VWxybIKBjvkgP+1eN6ZXJBP+YWAA5elOk2lIEX4qyzpkbU+g+gndORUtrytUCkJimw38Npe/Nea1xwL/ge3gOtNL/tUzJAZjxwsToa6Zehi5b/tyG7+kR18wDho0QuS/M= 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=FABWxOxM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=UnZTQ76F; arc=none smtp.client-ip=103.168.172.156 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="FABWxOxM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UnZTQ76F" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id C6F791140105; Sun, 24 Mar 2024 17:08:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 24 Mar 2024 17:08:36 -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=1711314516; x= 1711400916; bh=aeOBteVst3EdJ6UR71Pe68DjYvvvoVNomGTQddIcz0M=; b=F ABWxOxMaiAaFjfrTIpn8xZ1SlsSP+zN8bbO3cyoB4+bw8ZqYmmh27wQTwhnpT90g GuWg+WHa3j5y0sdz6C4TOhFeJPk9FX/6UBPr45QITUvMK3jRRuV3wP1EB4I/ytz3 mMj6LOdc1aOYVZU4y2MDg4nMg1ifXcXpaV9Etw8veYX9tAGDd3KT/cIe3cEvHZQw PRVSHp5+ZchFXBi2Q1nE6XUi+2DinsUdcRil4vKgGhDj44L+Y0UC6QWKa30rtwCn ek+Qjvt0I2fWwA1CFsIadEKOUN5gM4yiLWCbaNTqW5F3L8ld63JgTfCrCwNvBrFZ zKsOIox3ztQoz/R/y6+ag== 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=fm2; t=1711314516; x= 1711400916; bh=aeOBteVst3EdJ6UR71Pe68DjYvvvoVNomGTQddIcz0M=; b=U nZTQ76FfFKZNJu+L4b0fitqZ6J4QNki1q208Gblip6G/yXxvduazhfX16nUdPq5n 8ezV9RPHRag6nJbEcSWAbKSLsLeuKD/qOypZmGuVh/YBJHoT79wCpNcbv4GGF77m +fzPmfaB8XVYc1RVncN66J57mUj3u6CeC4uWvh+myiOdZMbagjuq4pyXW1m5Z22o EbkTulzstdZZ3KDLyk9YGAqA6Wf7ULOA0fogbxaepZ3vEgOJWBsfLKIbCzdUgNGq ChDSXljhwbJKPqdruS3AAEVEP07jP29N7lfdCj5SAsnb+GOMF46N16q6cpNEucG+ APgng802rB+/Y0ctueBJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtjedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Mar 2024 17:08:36 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hmh@hmh.eng.br, dmitry.torokhov@gmail.com, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, vsankar@lenovo.com, peter.hutterer@redhat.com Subject: [PATCH 2/4] platform/x86: thinkpad_acpi: Support for trackpoint doubletap Date: Sun, 24 Mar 2024 17:07:59 -0400 Message-ID: <20240324210817.192033-3-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> References: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lenovo trackpoints are adding the ability to generate a doubletap event. This handles the doubletap event and sends the KEY_DOUBLECLICK event to userspace. Signed-off-by: Mark Pearson Signed-off-by: Vishnu Sankar --- drivers/platform/x86/thinkpad_acpi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 82429e59999d..2bbb32c898e9 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -232,6 +232,7 @@ enum tpacpi_hkey_event_t { /* Misc */ TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ + TP_HKEY_EV_TRACKPOINT_DOUBLETAP = 0x8036, /* doubletap on Trackpoint*/ }; /**************************************************************************** @@ -4081,6 +4082,22 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) break; } fallthrough; /* to default */ + case 8: + /* 0x8036: Trackpoint doubletaps */ + if (hkey == TP_HKEY_EV_TRACKPOINT_DOUBLETAP) { + send_acpi_ev = true; + ignore_acpi_ev = false; + known_ev = true; + /* Send to user space */ + mutex_lock(&tpacpi_inputdev_send_mutex); + input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 1); + input_sync(tpacpi_inputdev); + input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 0); + input_sync(tpacpi_inputdev); + mutex_unlock(&tpacpi_inputdev_send_mutex); + break; + } + fallthrough; /* to default */ default: known_ev = false; } From patchwork Sun Mar 24 21:08:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13600926 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 7631B18EA8; Sun, 24 Mar 2024 21:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314520; cv=none; b=CV8y5m/2sBccP29iYOAiUIfvGm8DLdZxpj5CAKqBILoqLlnIZD6b7TqkMKSpKuT0GmdYTrQFehnz3Y8PkC33XRFlRV+wnU/MK0M/dqmdvz9R/utJpU6/HAeWbxDR/dBpKbH0XLUCjrCAnL7+9FWekdlKnXy+rzUKqpejTbCz+K4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314520; c=relaxed/simple; bh=g6WupTb5dbnL6Xg9TbYvNK6CI2ilfhW0pZM7alLeiRA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Aw6PRtmyphNzZhT4rSop30P1LnyJJNrTBSySgbiZSPtTEbjV/k1nG+0dhrKhLofJzNargzQ8xijPAPq60b022ghJnA4TtY/UzuoKPVl5tH7RfV4tsOB3/4PR62KtuABftfMA7WMQNrEIqqCadsSiWiAd9uPbtLmGi2hyx3PR6Ro= 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=Xv1PQDAa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=tIXQnmSo; arc=none smtp.client-ip=103.168.172.156 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="Xv1PQDAa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="tIXQnmSo" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 95FD311400FF; Sun, 24 Mar 2024 17:08:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 24 Mar 2024 17:08:37 -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=1711314517; x= 1711400917; bh=htD7Xc/EdF+0+xuTojpID1s7Z/g8szPikEsSNl9QK4E=; b=X v1PQDAa87vYZtlhCdr3oMr7hfMiDnB89+TG5GUhKLECL3PYa1RA5T2QZnYYyjDNE xXW10F0Z3fjEffKgulh7IqWRQfmZNi5ZA1Jxpy2kFtMv5fIak9DeJvDmhUssawu8 b2TOWNR4fE1mxCXgGpgka2QtL0EMw61iGMHFhN96uFEwO3nV9KIl/tpahl3HtCBG +DF+RCyQPjarj7FuUbaRdW/qKptCNjF7SKvF8DUrV7zlii+jva7U/L/22c/ToXj1 wZKxwh/ZX3tz/TPCgDnMmmGM/g4l6aKMe93zP0Cw5RFPz/qayd6TNM2AGdq5gxt+ xQHs8Wmi22dI5flAnwRKg== 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=fm2; t=1711314517; x= 1711400917; bh=htD7Xc/EdF+0+xuTojpID1s7Z/g8szPikEsSNl9QK4E=; b=t IXQnmSodIWj9KeSSIvelemGDk4kfHZAmPdxTEBrHvZLB0ZIQecaDDSShgGzN+IL1 RHU+ydpGCY2lgDMMX/ndd4eTVxfrMC6tCLnMJDLFdbDSvmVy3Fd5eamknqWHLH59 RUKl8kBDc7GsOVzITTIIXSDQ2HNVUFillNIBamwcYnMQljpJzqAB9ZRtr2zsZvL/ AO5CxYHuUtXfYnaj9lvlwCAgDNf1FYZXAcuXgl2yuMPisRDBBLZLChwbkVuhgJf1 9tCzkzhXM1iqsc7cWGfA7vus5izM1LrDlfF0mDAFU92zEZ5RT8BAC49ura1x3yF2 b6eW++LyOYvSm0gR66vpA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtjedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Mar 2024 17:08:36 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hmh@hmh.eng.br, dmitry.torokhov@gmail.com, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, vsankar@lenovo.com, peter.hutterer@redhat.com Subject: [PATCH 3/4] platform/x86: thinkpad_acpi: Support for system debug info hotkey Date: Sun, 24 Mar 2024 17:08:00 -0400 Message-ID: <20240324210817.192033-4-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> References: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 New Lenovo platforms are adding the FN+N key to generate system debug details that support can use for collecting important details on any customer cases for Windows. Add the infrastructure so we can do the same on Linux by generating a SYS_DEBUG_INFO keycode to userspace. Signed-off-by: Mark Pearson Signed-off-by: Nitin Joshi --- drivers/platform/x86/thinkpad_acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 2bbb32c898e9..854ce971bde2 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -1787,6 +1787,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_SYS_DEBUG_INFO = 81, /* Hotkey keymap size */ TPACPI_HOTKEY_MAP_LEN @@ -3337,6 +3338,9 @@ 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_UNKNOWN, /* AMT Toggle (event), 0x31A */ + KEY_UNKNOWN, KEY_UNKNOWN, + KEY_SYS_DEBUG_INFO, /* System debug info, 0x31D */ }, }; From patchwork Sun Mar 24 21:08:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13600927 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 69E481C291; Sun, 24 Mar 2024 21:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314521; cv=none; b=PxHBZ2Xw9fG2kjYV28z1ntiELn2k8E9IOqBC5iYtyP2LzgpWaAG9ECMrwemWvUKhIhi0Bo8df8V7JStY935GaPj67tiEFoIrZ6vWVz3VaeYdYH3qNj1FAioHj547QahIcDgFDWnzZrb0VLf+QHdjdQkIqxByLongjsw6oR/eBl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711314521; c=relaxed/simple; bh=LPqpb/BTLXp5dEMIZD2PSr8NXmFsTBoT9dhSycYnLhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QzmPP4+1thkoqNHkUibESLrpxWLjVIdzUwV5+qWLemQCTvKE1fmhAFwaTj5RuyCepnJmOFIIfuNQ14NT9PbTPwhEw0s4fXzUhDvpGavbylFwvWrQ0E6424uX5W8KKQuzrVrp3lk6W1cpVxpIv1rVvedYXe5DUeZJqUotwQip/9g= 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=ec8Kipxb; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VAL8N/sF; arc=none smtp.client-ip=103.168.172.156 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="ec8Kipxb"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VAL8N/sF" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 6361811400F5; Sun, 24 Mar 2024 17:08:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 24 Mar 2024 17:08:38 -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=1711314518; x= 1711400918; bh=lkjwIduruMi5XWo7srkLWDeR2ShYX9J54RxCXveF3IE=; b=e c8KipxblEsfe2xO3yWVPYh2e/SrbALb6c6wFJ6UvJWHKDIKlHubdCJ7lYlGuXj+C LYf//CwZeOddSWvcLNJLjfHYYoHEbxU5ok5OvSoa61hKZkoEo6Z3RBnVr6T9udgv t7VJFqiukfb5HVg4F1ozj3VtXK+kMg1z6XWxBl6JEVGes22Nz3e6WhWPf3uhyiIw Rnc55/RFqlYd0Vaw+BzjnglCQ0oMFDSLMVjdsl5lcE5C6cxmqnT15akSWeHzaGaV Dd07t4gprkLSw6+rcTxbUttSV2xC3y4ETn1iG1kdI32zGYRY+vPh0bdTiRklWf3g dOqep8Ydl2eO/rCjsZspA== 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=fm2; t=1711314518; x= 1711400918; bh=lkjwIduruMi5XWo7srkLWDeR2ShYX9J54RxCXveF3IE=; b=V AL8N/sFCz2LnqQ1RQHk6JF0XeznA7zEM+UQCmNR5lDKcQ79VhQy6q8rfkuSLWWBV EyuDctxNaihBquyh6IC7vNDB8miIf/u0Lp1Wo2xp1EyYd909Ky793CPNHcEdz5B8 2XgfgNYLy0j4b3I8fk5Y/qc1OIeooBzhdbk0cgHfB3P7zvcXJ6JfSnqyHvyUCten HFNx5YeLrQHqSgMV3pT+c8qSI/U5kwsq4gsZBmcU1zHSMtrbkSN1uxch8q0ni22z fT/DlqKWHvWjTPIBBpncEpxCu/kszlWaPXQHsxsVN+d0yJFm4rs9NHAzZq7g2p4c Hnh56OuxDdXKCHiJH88Ag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtjedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Mar 2024 17:08:37 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hmh@hmh.eng.br, dmitry.torokhov@gmail.com, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, vsankar@lenovo.com, peter.hutterer@redhat.com Subject: [PATCH 4/4] platform/x86: thinkpad_acpi: Support hotkey to disable trackpoint doubletap Date: Sun, 24 Mar 2024 17:08:01 -0400 Message-ID: <20240324210817.192033-5-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> References: <20240324210817.192033-1-mpearson-lenovo@squebb.ca> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The hotkey combination FN+G can be used to disable the trackpoint doubletap feature on Windows. Add matching functionality for Linux. Signed-off-by: Mark Pearson Signed-off-by: Vishnu Sankar Reviewed-by: Hans de Goede --- drivers/platform/x86/thinkpad_acpi.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 854ce971bde2..21756aa3d28d 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -167,6 +167,7 @@ enum tpacpi_hkey_event_t { TP_HKEY_EV_VOL_MUTE = 0x1017, /* Mixer output mute */ TP_HKEY_EV_PRIVACYGUARD_TOGGLE = 0x130f, /* Toggle priv.guard on/off */ TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */ + TP_HKEY_EV_DOUBLETAP_TOGGLE = 0x131c, /* Toggle trackpoint doubletap on/off */ TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile */ /* Reasons for waking up from S3/S4 */ @@ -354,6 +355,7 @@ static struct { u32 hotkey_poll_active:1; u32 has_adaptive_kbd:1; u32 kbd_lang:1; + u32 trackpoint_doubletap:1; struct quirk_entry *quirks; } tp_features; @@ -3598,6 +3600,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) hotkey_poll_setup_safe(true); + /* Enable doubletap by default */ + tp_features.trackpoint_doubletap = 1; + return 0; } @@ -3739,6 +3744,7 @@ static bool hotkey_notify_extended_hotkey(const u32 hkey) case TP_HKEY_EV_PRIVACYGUARD_TOGGLE: case TP_HKEY_EV_AMT_TOGGLE: case TP_HKEY_EV_PROFILE_TOGGLE: + case TP_HKEY_EV_DOUBLETAP_TOGGLE: tpacpi_driver_event(hkey); return true; } @@ -4092,13 +4098,15 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) send_acpi_ev = true; ignore_acpi_ev = false; known_ev = true; - /* Send to user space */ - mutex_lock(&tpacpi_inputdev_send_mutex); - input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 1); - input_sync(tpacpi_inputdev); - input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 0); - input_sync(tpacpi_inputdev); - mutex_unlock(&tpacpi_inputdev_send_mutex); + if (tp_features.trackpoint_doubletap) { + /* Send to user space */ + mutex_lock(&tpacpi_inputdev_send_mutex); + input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 1); + input_sync(tpacpi_inputdev); + input_report_key(tpacpi_inputdev, KEY_DOUBLECLICK, 0); + input_sync(tpacpi_inputdev); + mutex_unlock(&tpacpi_inputdev_send_mutex); + } break; } fallthrough; /* to default */ @@ -11228,6 +11236,8 @@ static void tpacpi_driver_event(const unsigned int hkey_event) /* Notify user space the profile changed */ platform_profile_notify(); } + if (hkey_event == TP_HKEY_EV_DOUBLETAP_TOGGLE) + tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap; } static void hotkey_driver_event(const unsigned int scancode)