Skip to content

Commit 22d6d06

Browse files
Aseda AboagyeBenjamin Tissoires
authored andcommitted
input: Add support for "Do Not Disturb"
HUTRR94 added support for a new usage titled "System Do Not Disturb" which toggles a system-wide Do Not Disturb setting. This commit simply adds a new event code for the usage. Signed-off-by: Aseda Aboagye <aaboagye@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/Zl-gUHE70s7wCAoB@google.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
1 parent 0c7dd00 commit 22d6d06

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

drivers/hid/hid-debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,6 +3367,7 @@ static const char *keys[KEY_MAX + 1] = {
33673367
[KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable",
33683368
[KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle",
33693369
[KEY_ACCESSIBILITY] = "Accessibility",
3370+
[KEY_DO_NOT_DISTURB] = "DoNotDisturb",
33703371
[KEY_DICTATE] = "Dictate",
33713372
[KEY_MICMUTE] = "MicrophoneMute",
33723373
[KEY_BRIGHTNESS_MIN] = "BrightnessMin",

drivers/hid/hid-input.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
833833
break;
834834
}
835835

836+
if ((usage->hid & 0xf0) == 0x90) { /* SystemControl*/
837+
switch (usage->hid & 0xf) {
838+
case 0xb: map_key_clear(KEY_DO_NOT_DISTURB); break;
839+
default: goto ignore;
840+
}
841+
break;
842+
}
843+
836844
if ((usage->hid & 0xf0) == 0xa0) { /* SystemControl */
837845
switch (usage->hid & 0xf) {
838846
case 0x9: map_key_clear(KEY_MICMUTE); break;

include/uapi/linux/input-event-codes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@
619619
#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
620620
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
621621
#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
622+
#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
622623

623624
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
624625
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */

0 commit comments

Comments
 (0)