From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, Shyam-sundar.S-k@amd.com,
hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
Patil.Reddy@amd.com
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Armin Wolf <W_Armin@gmx.de>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH v5] drivers/platform/x86/amd: pmf: Update screen lock actions to KEY_SCREENSAVER
Date: Mon, 28 Apr 2025 15:03:57 -0500 [thread overview]
Message-ID: <20250428200456.4094500-1-superm1@kernel.org> (raw)
From: Mario Limonciello <mario.limonciello@amd.com>
Screen lock actions are ignored by popular desktop environments currently.
This is because `KEY_SCREENLOCK` is not one of the legacy keys that popular
desktop environments listen to by default, `KEY_SCREENSAVER` is.
Adjust the PMF driver to use the correct keycode.
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Armin Wolf <W_Armin@gmx.de>
Fixes: 4c92d448e3e61 ("platform/x86/amd/pmf: Use existing input event codes to update system states")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v5:
* As Dmitry pointed out that GNOME listens to multiple keys even if not advertised
it meant there was a bug either in GNOME or the PMF driver. Turns out it's in the PMF driver!
Switch key combinations instead of using META+L
---
drivers/platform/x86/amd/pmf/tee-if.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c
index 7d6404ab9f041..a182a3a6daf11 100644
--- a/drivers/platform/x86/amd/pmf/tee-if.c
+++ b/drivers/platform/x86/amd/pmf/tee-if.c
@@ -172,7 +172,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);
+ amd_pmf_update_uevents(dev, KEY_SCREENSAVER);
break;
default:
dev_err(dev->dev, "Invalid PMF policy system state: %d\n", val);
@@ -458,7 +458,7 @@ 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_SCREENSAVER);
input_set_capability(dev->pmf_idev, EV_KEY, KEY_SUSPEND);
err = input_register_device(dev->pmf_idev);
--
2.43.0
next reply other threads:[~2025-04-28 20:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 20:03 Mario Limonciello [this message]
2025-04-28 22:05 ` [PATCH v5] drivers/platform/x86/amd: pmf: Update screen lock actions to KEY_SCREENSAVER Dmitry Torokhov
2025-04-28 22:41 ` Mario Limonciello
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=20250428200456.4094500-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=Patil.Reddy@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=W_Armin@gmx.de \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--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