From patchwork Wed Apr 17 17:31:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13633686 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 8E6DC17166F; Wed, 17 Apr 2024 17:31:35 +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=aJfxxvcTt2nHL3/wdZ0MHAxlqZFmMKbJ+P6lbDi3ci5sfJ9EKMl/BE0dpfe9Ag91irZ7DLEklQwHhw+5oT2/qS6rJ1MNNZCWSIa1mEnKxeMkc9pRrrjWuwgYa38fxcDYyMPOuSSoDzQi9pKhnqP+apo6avZH1uwRfqX2Ofo6/8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375098; c=relaxed/simple; bh=wO4+zecjacYU614piFeSaVyXG3E3j3lSRVKYXk0fH8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mwp6Qr1UwbvOjm7JsSdpXTrUkahBS8lIJ/Lt4bo7AeWWqOyplvrgsPn/7Mz+RMSVlYU0Oy6DBY1zz9WyMHrayVmme67Ee0mqvQjfwlRXcSMQ5xo5Sv+wCPV50UxIKcdRnCrQmXoWsCEB53+URdLvzxQ9I0URoBtdJDP+hhphEN0= 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=XCTh1WsG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=inT51Q5R; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="XCTh1WsG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="inT51Q5R" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 81A891380240; Wed, 17 Apr 2024 13:31:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 17 Apr 2024 13:31:34 -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=1713375094; x= 1713461494; bh=8PaLecGiVuq16/Fn0qwhMRkqDVyOGQRBV6HYgL9CGPM=; b=X CTh1WsG7m7CeWuQXzC6O9miHFzw7D7qogV4q3SIgTXTOezHTWs4TYFVbNOiLpK5P ZUZWne6ullHLdyoYENd4KYt7U4FFn6tseiMHLfBu9jCay5g/vd35WjCLprlv+HPG o1BJ2Om3QJ1y0L3/VEu1mkYfnApBMjRtJ5yxuBfm4AnSo6+N6z0hTrd9D3O2ndW+ b/6DMztpxkqmRZJ56D/Fk8qVYub/LVySUt5NUgVPmu2qZETJQbZxMyirDJB7dfPJ AGuddqf5AltN/eSyWCW87w3pemY2hfuCidZ6arGaGGO3pxSUM/5Bz+im8BreGyC3 kijRMeqE2gEAdaAKgXeQg== 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=1713375094; x= 1713461494; bh=8PaLecGiVuq16/Fn0qwhMRkqDVyOGQRBV6HYgL9CGPM=; b=i nT51Q5R7oQKSCArWg0YNMpfyKJd/hHShDzSR5iBBiJSTZfmnJq2URZk0Y7Z56inP 1ccdyRP7RWYVW/Yb5fSp0zy9odDDVZL23rMQSxVS16zzwwc9W/BX3lAJ2sRVPJ9l AnDEQlPMGv9yHj42TnP4PdKrfAvoWxEFrnZJyGDg5WOyQuCOF4ge5ZQ4h5BCc1gE cT94rw14Ju92fYhGNW5zDyjL7UJlsPbPj0UZG6GzswUoSAy7PBsmGxlfqOvQbFml V3PDAHCkcTgeUPaUf2oOaozkumj85CBDbXHyrDA1Mo99runo23Laxe2FbvQk3iqT TB1MXnSPcvdFEYKZQmi2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejkedguddufecutefuodetggdotefrod 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:33 -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 Subject: [PATCH v2 1/4] platform/x86: thinkpad_acpi: simplify known_ev handling Date: Wed, 17 Apr 2024 13:31:06 -0400 Message-ID: <20240417173124.9953-1-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Modify how known_ev event is handled in preparation for adding new keycode range. Signed-off-by: Mark Pearson --- Changes in v2: - New addition to series based on recommendations from review. - Note previous input patch was dropped so in numbering gets replaced by this. drivers/platform/x86/thinkpad_acpi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 82429e59999d..3b48d893280f 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -4026,6 +4026,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) send_acpi_ev = true; ignore_acpi_ev = false; + known_ev = false; switch (hkey >> 12) { case 1: @@ -4051,8 +4052,6 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) /* FIXME: kick libata if SATA link offline */ known_ev = true; break; - default: - known_ev = false; } break; case 4: @@ -4078,11 +4077,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) tpacpi_send_radiosw_update(); send_acpi_ev = 0; known_ev = true; - break; } - fallthrough; /* to default */ - default: - known_ev = false; + break; } if (!known_ev) { pr_notice("unhandled HKEY event 0x%04x\n", hkey); From patchwork Wed Apr 17 17:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13633687 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 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 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: platform-driver-x86@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_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); From patchwork Wed Apr 17 17:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13633688 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 9A78217167E; Wed, 17 Apr 2024 17:31:37 +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=1713375099; cv=none; b=BmOQP3GXQdDOizQTJD2ldlsQKBRe4GT8mc1cbUvdVB/gPj1gQROsYQRpjZf2rxWNdDeBKVq1FlupZhWB6RbwnsVW3c4qHX4rW8W6+McRm1zT7FjjegsGrH6niM2IOioZxW0z0thsc3OLR4Wcb4so+PhWk6ZaLvJMjum95VMOFts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375099; c=relaxed/simple; bh=0JAHJiBAOZAwICYmCaHzyi8YM+hQp8n1NB8LRVAqEtQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a/PDfYdPb/vmi2R7HlVF/RYby2+N8b+FWdYxziS7MHgarJJOvwmbkQ40TapmJkjGdYLPhjFc1k6He6Txt1WkKf5Se6dsra8b0SoX/Toe4HuAc+Kpa0KP2s3K7+b3/U+hVwj12yIYBGmJlBEyTNJH+5mS8l5H9D7TzA024wrNiic= 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=gHIjITaq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Sq6Ra274; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="gHIjITaq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Sq6Ra274" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id A1049138018C; Wed, 17 Apr 2024 13:31:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 17 Apr 2024 13:31: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=1713375096; x= 1713461496; bh=SYwB9sIOejL6LQqFoRXrJ2e291n7cnRoAR//09q6alM=; b=g HIjITaqGmgxzjcSsqZ5eMyEO4d79+zifVs0fL2PAeHvSkVHBfFrB6HBXpvLvtv4I FsbmSdwGAgwlQTXVhUfjgsIKGoOMgigxk+oBoDmKT41WgXKhCVE0C5H8IC1/m7l8 gINOx4wmNcBOecRC76AfOHkO/N31qPWOinFo/udBbXyG1HzRUsHO1nabXFrMqOp7 a5yEKzZAd9dSALhRPI/rgt3cZixoCVwEc21MySD9Wb4jgjFnL9r1HKXiZx+9zW3W kiAuZptu5TrKBYZKW3Cj/OoxWcOKbKG+ZDdfQ4L6tHMoXVYj+y7pCNbLJRYjLUr8 q79wX5mghooSpGC6rnH0Q== 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=1713375096; x= 1713461496; bh=SYwB9sIOejL6LQqFoRXrJ2e291n7cnRoAR//09q6alM=; b=S q6Ra274NNPz4HODcAH1XBmQKuvlVCPdm5yrDbo//JzgGs1XAZO5L0s3KFfeIlCy+ uOJOzfGvnNSR9T11x+GEe5llQWetx/45U9OWTT37tBJ+Rs6J8r78+6DznzT/cHo/ efFhy0IUg8nsyN9ZnMT5j2NuD9w6t/uolI3RlZI7tp4KmilIbsm+KZ7OajOSacec qM4Q/d8T3CwkLZVe+tsgBCCJztBNO7N3wuFTXu3DxSEVZJI1kOeLF+8Qj1gSSfVZ dzOJPHHAl6Th7W/sk0yeSW5MMfWKINNURZp5P/5SRGVr6dhSKkB+oVCuYU3d7QLF 8JqbVHsjS+kH7yJBMiRiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejkedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Apr 2024 13:31:35 -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 Subject: [PATCH v2 3/4] platform/x86: thinkpad_acpi: Support for system debug info hotkey Date: Wed, 17 Apr 2024 13:31:08 -0400 Message-ID: <20240417173124.9953-3-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: platform-driver-x86@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_VENDOR keycode to userspace. Signed-off-by: Mark Pearson Signed-off-by: Nitin Joshi --- Changes in v2: - Improved comments on keycodes in init function. - Filled in missing gaps drivers/platform/x86/thinkpad_acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 6d04d45e8d45..a2f21e958d39 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -1789,6 +1789,10 @@ 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_AMT_TOGGLE, + TP_ACPI_HOTKEYSCAN_CAMERA_SHUTTER, + TP_ACPI_HOTKEYSCAN_DOUBLETAP_TOGGLE, + TP_ACPI_HOTKEYSCAN_SYS_DEBUG_INFO, TP_ACPI_HOTKEYSCAN_DOUBLETAP, /* Hotkey keymap size */ @@ -3340,6 +3344,10 @@ 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 handled in driver, 0x31a */ + KEY_UNKNOWN, /* Camera Shutter Switch, 0X31b */ + KEY_UNKNOWN, /* DOUBLETAP_TOGGLE, 0x31c */ + KEY_VENDOR, /* System debug info, 0x31D */ KEY_PROG1, /* Trackpoint doubletap */ }, }; From patchwork Wed Apr 17 17:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13633689 Received: from fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com [103.168.172.159]) (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 CBD0B172769; Wed, 17 Apr 2024 17:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375100; cv=none; b=KNTEVpmCqeeCsagPpYwejI4vP2dBID1GzCbO+igSdQr9hTbbEqY61g+IHXZAPYwLgpm19HayIwrChiAVbZ6Dvj32Hgv87/Vqhjawk0lqIm8ndY6U/J/9IlLuFCTk0sjeNtNixRgb/nRmmDrAUDkVFBpIt1HVggj8plN5wHDKkC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713375100; c=relaxed/simple; bh=5mq/3VaDjM+a0aZuQQ8ckJMi8Tqqj3fYB2vmVsLvSMk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GNIZ5aIBq9yDUCf5Z7i0XOlg/k4tShH6IGYoHbRnvl/tjejJBJbB2KqWjZzaoj8ACtcW91FfD4Jp1W2f2XFm3d/q7g6r5HZN3QbHg2p8j1EXl74fD1zZdM4S2TKfReI0od5moVOCtQbp1NN9t8iK02WlQqyby3nUXJKP4IPshqg= 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=FRW1jy6t; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dZCVnAQ6; arc=none smtp.client-ip=103.168.172.159 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="FRW1jy6t"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dZCVnAQ6" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id D80DD11400C2; Wed, 17 Apr 2024 13:31:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 17 Apr 2024 13:31: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=1713375097; x= 1713461497; bh=DhmHMbnueY9obyK3Uu3OflyO7wvdBkCNYtIONEP8n/c=; b=F RW1jy6t0xW2zo4T5QhlFZJhRf+xTFcrImgwBtGicxoTanubLLxq3YzqUBeIeXyiV KIw4neE81KJfJmgJD/axlRG96fAXh3rlFj87psuyOBLJPuAy3EXg3lsa7SBwsIp0 ia12czfe8G2cc/XzaUQ4FUWJl3eVp6tSEtFEJcWZ040ZXTvAcg0G0eNSi8WahOq/ RN5jkmeHRsoR+EPFVh++KyuL+/xVHgMO820sNx8QkyjfqC/n8EUeTUfWdM+8Pptv zjh8rIHOIiyF8O7xdYCZObUZ45T/sTBbsbTSl4/1wQQHwT7XpbSAw2T4tdoGmr2D YRsTRzZH2cfapf9OF+hcg== 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=1713375097; x= 1713461497; bh=DhmHMbnueY9obyK3Uu3OflyO7wvdBkCNYtIONEP8n/c=; b=d ZCVnAQ68OX2WGmj1CGIPC8cl0J9mgyWBbrfa4jRtajtrPgdiVoA+WLUFf7dD1Kx4 5i9RQAdzOZTPyBcgcTtd1L23eUxgq0MMa3/h0bSEckzbBjmSvumPBabaDVl9B9DW +IkLJ03wW9HlQEnKxWvjxAavh+UWHrHd0DKe5wTqP5oc11Df/hJ+hEKDhoODEaPm Vm2LplCa8EcPvRgZiqqYb4jYMKM852csSHu54cn4BAT1wVgPasjxzR8wyK1IBOyn ftb0S4wIVZ/YBIptlWLBBcV558OedxcwE3qm069L2+OcOW2/cpJBbewjHKhFQN5m NP+890mg9ZiCde5jEg9NA== 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:36 -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 4/4] platform/x86: thinkpad_acpi: Support hotkey to disable trackpoint doubletap Date: Wed, 17 Apr 2024 13:31:09 -0400 Message-ID: <20240417173124.9953-4-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: platform-driver-x86@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 --- Changes in v2: - Improved comments on keycodes in init function drivers/platform/x86/thinkpad_acpi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a2f21e958d39..370b9285156c 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 */ @@ -356,6 +357,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; @@ -3346,7 +3348,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) KEY_HANGUP_PHONE, /* Decline incoming call */ KEY_UNKNOWN, /* AMT_TOGGLE handled in driver, 0x31a */ KEY_UNKNOWN, /* Camera Shutter Switch, 0X31b */ - KEY_UNKNOWN, /* DOUBLETAP_TOGGLE, 0x31c */ + KEY_UNKNOWN, /* DOUBLETAP_TOGGLE handled in driver, 0x31c */ KEY_VENDOR, /* System debug info, 0x31D */ KEY_PROG1, /* Trackpoint doubletap */ }, @@ -3606,6 +3608,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; } @@ -3747,6 +3752,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; } @@ -4011,7 +4017,7 @@ static bool hotkey_notify_6xxx(const u32 hkey, static bool hotkey_notify_8xxx(const u32 hkey) { - if (hkey == TP_HKEY_EV_TRACK_DOUBLETAP) { + if (hkey == TP_HKEY_EV_TRACK_DOUBLETAP && tp_features.trackpoint_doubletap) { tpacpi_input_send_key(TP_ACPI_HOTKEYSCAN_DOUBLETAP); return true; } @@ -11229,6 +11235,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)