From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 093741607A0; Tue, 18 Jun 2024 12:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718714272; cv=none; b=YlzFg63UqHuM6gf2vl0LwUiIUxbVV1lvWvoWQXLehae4urz4i8EDc7GmCjvA40mz38+6jEguXjzoAtcML5KR2UhB33K1eXJ89IxO/jfInM3+fKa4RRYgRNdFqFpeRVuC7OVvKlubTncvDnCZcfVfEOHfplly46haBL2dBctcRWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718714272; c=relaxed/simple; bh=fTypj0pLySXTgmrYxzbve/VcRyKTFDL9FMJi/IuO0xE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PwtnzDuIC0/m3iQzAR+oUE1PCf+Kj4cfoq5l1uczkjQX2pCBKmDT03Ltmet52EVB2BqXBahmLoAwzwnvhS5tMKje/Q2ioTxxVJsb42Ir8ychaGB4Xq7fzp0iwvHdf1X2Q5ARWnTloHGB0uMWFW11HWkS+Y1LugGHC7gVzdPtry0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X94qIB2m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X94qIB2m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B04FAC32786; Tue, 18 Jun 2024 12:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718714271; bh=fTypj0pLySXTgmrYxzbve/VcRyKTFDL9FMJi/IuO0xE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X94qIB2m5lpk8anJ2nLw2KN4Yi09+O0GQKjHcNhhtp0L8PdkL2skjm0Dktxp7Khjr yVCloLpwoSaiWvO4RI7PZTHQOw4vmU3osQJ2gG9LTBrqpH4FJvdZtwdcMUsMvkJPGm OxyKy5DAanI9TZO9+ljAp1M7zA1aRu1mgVXPPgGnV5t2H8FTWyEEbFPMHiCiJoNFGw eNzZgYNReRuj0XxtTCoyNkGzOHx7gfUfjC3cv5NDvO/b8FPekfwct+aCGjs0wM7WC/ p48M1wT4JSgTCQOE24zF35MQ6+5YxzqLkCXv9Bg7/uht1tcNt81GyfN4xTHJZbGDMn 7GVmnnNL39uMQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aseda Aboagye , Dmitry Torokhov , Benjamin Tissoires , Sasha Levin , jikos@kernel.org, linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 6.9 43/44] input: Add support for "Do Not Disturb" Date: Tue, 18 Jun 2024 08:35:24 -0400 Message-ID: <20240618123611.3301370-43-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618123611.3301370-1-sashal@kernel.org> References: <20240618123611.3301370-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.9.5 Content-Transfer-Encoding: 8bit From: Aseda Aboagye [ Upstream commit 22d6d060ac77955291deb43efc2f3f4f9632c6cb ] 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 Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/Zl-gUHE70s7wCAoB@google.com Signed-off-by: Benjamin Tissoires Signed-off-by: Sasha Levin --- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 8 ++++++++ include/uapi/linux/input-event-codes.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index c629ab161d5b2..5302bfd527d86 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -975,6 +975,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", [KEY_ACCESSIBILITY] = "Accessibility", + [KEY_DO_NOT_DISTURB] = "DoNotDisturb", [KEY_DICTATE] = "Dictate", [KEY_MICMUTE] = "MicrophoneMute", [KEY_BRIGHTNESS_MIN] = "BrightnessMin", diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index d5a6e89c3086e..8bb16e9b94aa5 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -833,6 +833,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel break; } + if ((usage->hid & 0xf0) == 0x90) { /* SystemControl*/ + switch (usage->hid & 0xf) { + case 0xb: map_key_clear(KEY_DO_NOT_DISTURB); break; + default: goto ignore; + } + break; + } + if ((usage->hid & 0xf0) == 0xa0) { /* SystemControl */ switch (usage->hid & 0xf) { case 0x9: map_key_clear(KEY_MICMUTE); break; diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 39f11ec676fae..a4206723f5033 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -619,6 +619,7 @@ #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ #define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */ +#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ -- 2.43.0