From: Hans de Goede <hansg@kernel.org>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: Hans de Goede <hansg@kernel.org>,
linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: [PATCH 1/2] Input: Add keycodes for electronic privacy screen on/off hotkeys
Date: Mon, 20 Oct 2025 17:23:30 +0200 [thread overview]
Message-ID: <20251020152331.52870-2-hansg@kernel.org> (raw)
In-Reply-To: <20251020152331.52870-1-hansg@kernel.org>
Add keycodes for hotkeys toggling the electronic privacy screen found on
some laptops on/off.
There already is an API for eprivacy screens as kernel-mode-setting drm
connector object properties:
https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
this API also supports reporting when the eprivacy screen is turned on/off
by the embedded-controller (EC) in response to hotkey presses.
But on some laptops (e.g. the Dell Latitude 7300) the firmware does not
allow querying the presence nor the status of the eprivacy screen at boot.
This makes it impossible to implement the drm connector properties API
since drm objects do not allow adding new properties after creation and
the presence of the eprivacy cannot be detected at boot.
The first notice of the presence of an eprivacy screen on these laptops is
an EC generated (WMI) event when the eprivacy screen hotkeys are pressed.
In this case the new keycodes this change adds can be generated to notify
userspace of the eprivacy screen on/off hotkeys being pressed, so that
userspace can show the usual on-screen-display (OSD) notification for eprivacy
screen on/off to the user. This is similar to how e.g. touchpad on/off
keycodes are used to show the touchpad on/off OSD.
Signed-off-by: Hans de Goede <hansg@kernel.org>
---
include/uapi/linux/input-event-codes.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index ca5851e97fac..d2987786c28e 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -630,6 +630,18 @@
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
+/*
+ * Keycodes for hotkeys toggling the electronic privacy screen found on some
+ * laptops on/off. Note when the embedded-controller turns on/off the eprivacy
+ * screen itself then the state should be reported through drm connecter props:
+ * https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
+ * Except when implementing the drm connecter properties API is not possible
+ * because e.g. the firmware does not allow querying the presence and/or status
+ * of the eprivacy screen at boot.
+ */
+#define KEY_EPRIVACY_SCREEN_ON 0x252
+#define KEY_EPRIVACY_SCREEN_OFF 0x253
+
#define KEY_KBDINPUTASSIST_PREV 0x260
#define KEY_KBDINPUTASSIST_NEXT 0x261
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262
--
2.51.0
next prev parent reply other threads:[~2025-10-20 15:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 15:23 [PATCH 0/2] Input: Add keycodes for electronic privacy screen on/off an use these in dell-wmi Hans de Goede
2025-10-20 15:23 ` Hans de Goede [this message]
2025-10-27 18:27 ` [PATCH 1/2] Input: Add keycodes for electronic privacy screen on/off hotkeys Dmitry Torokhov
2025-10-20 15:23 ` [PATCH 2/2] platform/x86: dell-wmi-base: Handle electronic privacy screen on/off events Hans de Goede
2025-10-22 17:54 ` [PATCH 0/2] Input: Add keycodes for electronic privacy screen on/off an use these in dell-wmi Dmitry Torokhov
2025-10-22 18:24 ` Hans de Goede
2025-10-22 18:40 ` Dmitry Torokhov
2025-10-22 19:15 ` Hans de Goede
2025-10-22 20:24 ` Dmitry Torokhov
2025-10-23 13:42 ` Hans de Goede
2025-10-27 18:28 ` Dmitry Torokhov
2025-10-28 16:37 ` Ilpo Järvinen
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=20251020152331.52870-2-hansg@kernel.org \
--to=hansg@kernel.org \
--cc=andy@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-input@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).