X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH v5] drivers/platform/x86/amd: pmf: Update screen lock actions to KEY_SCREENSAVER
@ 2025-04-28 20:03 Mario Limonciello
  2025-04-28 22:05 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2025-04-28 20:03 UTC (permalink / raw)
  To: mario.limonciello, Shyam-sundar.S-k, hdegoede, ilpo.jarvinen,
	Patil.Reddy
  Cc: Dmitry Torokhov, Armin Wolf, platform-driver-x86

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-28 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-28 20:03 [PATCH v5] drivers/platform/x86/amd: pmf: Update screen lock actions to KEY_SCREENSAVER Mario Limonciello
2025-04-28 22:05 ` Dmitry Torokhov
2025-04-28 22:41   ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox