Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aseda Aboagye and committed by
Benjamin Tissoires
22d6d060 0c7dd00d

+10
+1
drivers/hid/hid-debug.c
··· 3367 3367 [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", 3368 3368 [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", 3369 3369 [KEY_ACCESSIBILITY] = "Accessibility", 3370 + [KEY_DO_NOT_DISTURB] = "DoNotDisturb", 3370 3371 [KEY_DICTATE] = "Dictate", 3371 3372 [KEY_MICMUTE] = "MicrophoneMute", 3372 3373 [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
+8
drivers/hid/hid-input.c
··· 833 833 break; 834 834 } 835 835 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 + 836 844 if ((usage->hid & 0xf0) == 0xa0) { /* SystemControl */ 837 845 switch (usage->hid & 0xf) { 838 846 case 0x9: map_key_clear(KEY_MICMUTE); break;
+1
include/uapi/linux/input-event-codes.h
··· 619 619 #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ 620 620 #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ 621 621 #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)*/ 622 623 623 624 #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ 624 625 #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */