From: Mario Limonciello <superm1@kernel.org>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE,
JOYSTICK, TOUCHSCREEN)...),
linux-kernel@vger.kernel.org (open list),
platform-driver-x86@vger.kernel.org (open list:AMD PMF DRIVER),
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 2/2] platform/x86/amd: pmf: Use meta + L for screen lock command
Date: Mon, 7 Apr 2025 10:27:05 -0500 [thread overview]
Message-ID: <20250407152705.1222469-2-superm1@kernel.org> (raw)
In-Reply-To: <20250407152705.1222469-1-superm1@kernel.org>
From: Mario Limonciello <mario.limonciello@amd.com>
In practice userspace software doesn't react to KEY_SCREENLOCK by default.
So any time that the PMF policies would suggest to lock the screen (for
example from an HPD sensor event) userspace isn't configured to do it.
However userspace is configured for meta + L as this is the default
in the PC ecosystem. Adjust the PMF driver to send meta + L.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2:
* Use helper from linux-input
---
drivers/platform/x86/amd/pmf/tee-if.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c
index 20521d1f28f22..4bda905c3ba5c 100644
--- a/drivers/platform/x86/amd/pmf/tee-if.c
+++ b/drivers/platform/x86/amd/pmf/tee-if.c
@@ -170,7 +170,7 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_
amd_pmf_update_uevents(dev, KEY_SUSPEND);
break;
case 2:
- amd_pmf_update_uevents(dev, KEY_SCREENLOCK);
+ input_report_lock_sequence(dev->pmf_idev);
break;
default:
dev_err(dev->dev, "Invalid PMF policy system state: %d\n", val);
@@ -441,8 +441,9 @@ int amd_pmf_register_input_device(struct amd_pmf_dev *dev)
dev->pmf_idev->phys = "amd-pmf/input0";
input_set_capability(dev->pmf_idev, EV_KEY, KEY_SLEEP);
- input_set_capability(dev->pmf_idev, EV_KEY, KEY_SCREENLOCK);
input_set_capability(dev->pmf_idev, EV_KEY, KEY_SUSPEND);
+ input_set_capability(dev->pmf_idev, EV_KEY, KEY_L);
+ input_set_capability(dev->pmf_idev, EV_KEY, KEY_LEFTMETA);
err = input_register_device(dev->pmf_idev);
if (err) {
--
2.43.0
next prev parent reply other threads:[~2025-04-07 15:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 15:27 [PATCH 1/2] Input: Add a helper for reporting a screen lock key sequence Mario Limonciello
2025-04-07 15:27 ` Mario Limonciello [this message]
2025-04-16 20:39 ` Armin Wolf
2025-04-16 20:43 ` Mario Limonciello
2025-04-16 23:06 ` Armin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250407152705.1222469-2-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=Shyam-sundar.S-k@amd.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox