From patchwork Tue Jun 4 23:10:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aseda Aboagye X-Patchwork-Id: 13685974 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5901D14D2BE for ; Tue, 4 Jun 2024 23:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717542652; cv=none; b=gAaSQhBhj+CDoufCuyyK2gh/VG8ENCkyja20YxAdfgFS3fs1rd5DfVCNLQYVOLpt1We4DJ5371JkdzUf9rx8+kBUSZ1KJTjj3uaVy7B7d82MT/IGLpf1HGSqxS2YLwbGwrjq/EnWUYqP7ZBQaQ20Ieodyan/gNySRhGzX9KTTuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717542652; c=relaxed/simple; bh=q6f3+CEmSn/sqvDrtRo134SUJ6qrjd6MtwMfh0xatDY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Qwb4/UNO4L7nyMUdU8Momf09Ec7pwjur5DAJQST1S06nBFRCWn0DKM5A74r5U3NAiqi4iAnv/miswYiPtN2tPtyHTZtEkikNiIxdmmMnO/Yoxo8KWHQdz5+yAz3+oFAfDlt+ftFvutGpRpKx8iCHxfuT0lFDnGdPzlp4FMcJ/nA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=l5Hd08P1; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="l5Hd08P1" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f44b42d1caso47523765ad.0 for ; Tue, 04 Jun 2024 16:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717542650; x=1718147450; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=F53mgWQuLqtm94K/4iUoD0dBowWP+KqYs30+ZsKPSm8=; b=l5Hd08P1SqInpMVDh+E4hnqwkNjyQ8AkgDTvN3sIAJcNGjc6IK6nwAEOweWrHjPJFE ITFMGXz6+qwYreIrXfyiW4b3w+6OSCItvALu0j/zHbTZNHgLZhd4Hud7E22OSaoNpCcm 2HQPeNQpTmFBvYKgBqaZXwPQHSC5acrhoPBLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717542650; x=1718147450; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F53mgWQuLqtm94K/4iUoD0dBowWP+KqYs30+ZsKPSm8=; b=H/WXCbTmo0YNqn8otGgaAnAVfqVs588hc2/y9kmpQqd1xEkFdzK6CSzB81c/GWuWEG fSKflIZx/Yrb2Tty65eibJjjoO7LXnm4NAD0PwaeC2zumP2w08XO2zLfDs5QFL5daIis IGNhZlS7CKUnjTWHciMKt28Z0aYQbGVt4h1oJn06+JFgu0+sZJqw4MnZCeNdPd2B2ulf Cr9PRNJlo+MC5Ni2L0Br6Pc1VrfteHIPplpTCa3C3ECSZaNpamCAYGpKK9zz9Dypz3OI HSK+dYMocGpgspYg5Ga31XRfLgb/XiLu0zBSVYyEPfVyWLoxB5ZU3lloWxZDESFjoB+/ FPQA== X-Forwarded-Encrypted: i=1; AJvYcCU6afZMoQfwHSELURv9svdbGFcjGOFsZx+9LLYEmvY0/6Gp7FoebZDhspFmTZipNocjvlyEs4eJHqYHtYCJKZL67l87r7sIhV6GCG0= X-Gm-Message-State: AOJu0YyFqbC/joiLwsf6KCwW8llHDgZvY8/2p7lKIunhyHSX7TiVbtZq /EKTN/6QlgnYfH0HTgUCFhuTetwr2xHj4eodC2I84m06yb+6UyJFO9kBKHLReQ== X-Google-Smtp-Source: AGHT+IEtP2AblCN7iPchkTB7bxIFx966aC4UArKxoWIrDxd+EHukHNgD6eq4PaqUz3aJE1Fr63NUOw== X-Received: by 2002:a17:903:120c:b0:1f6:857b:b5c with SMTP id d9443c01a7336-1f6a5a12db5mr11946905ad.32.1717542650333; Tue, 04 Jun 2024 16:10:50 -0700 (PDT) Received: from google.com ([2620:15c:9d:200:72e1:5805:701a:f116]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f63241c39dsm88644665ad.297.2024.06.04.16.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 16:10:49 -0700 (PDT) Date: Tue, 4 Jun 2024 23:10:47 +0000 From: Aseda Aboagye To: Jiri Kosina Cc: Benjamin Tissoires , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH v4 1/2] input: Add event code for accessibility key Message-ID: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline HUTRR116 added support for a new usage titled "System Accessibility Binding" which toggles a system-wide bound accessibility UI or command. This commit simply adds a new event code for the usage. Signed-off-by: Aseda Aboagye Acked-by: Dmitry Torokhov --- Changes from v3: - Fixed patch sending workflow to not muck with whitespace. Changes from v2: - None Changes from v1: - Modified formatting to match existing code, ignoring checkpatch.pl. drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 1 + include/uapi/linux/input-event-codes.h | 1 + 3 files changed, 3 insertions(+) base-commit: 5128de84d8fc849400d00f7a6982711f129699ea diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index e7ef1ea107c9..7749c81b6227 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -974,6 +974,7 @@ static const char *keys[KEY_MAX + 1] = { [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", + [KEY_ACCESSIBILITY] = "Accessibility", [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 851ee86eff32..1ecc5ad57b56 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -829,6 +829,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel if ((usage->hid & 0xf0) == 0xa0) { /* SystemControl */ switch (usage->hid & 0xf) { case 0x9: map_key_clear(KEY_MICMUTE); break; + case 0xa: map_key_clear(KEY_ACCESSIBILITY); break; default: goto ignore; } break; diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 022a520e31fc..7ff6eeef1af0 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -617,6 +617,7 @@ #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ #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_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ From patchwork Tue Jun 4 23:16:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aseda Aboagye X-Patchwork-Id: 13685979 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9A7B145B05 for ; Tue, 4 Jun 2024 23:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717542997; cv=none; b=jjb9Lb9R4qxj3GrmshLSDqzyvTSfuDAvvV+NjF/nTuAVAUKl/Zi2TMFaJK+2XKxenqDpBceClnslMXAsEZU+3ohvIZ3VfZgG2jpaD80qSkb91i7ogWxTVhCkjWcdGUPMg84m1A6H1uWa/kl8opm1JFI45zdyn4saVhRFgKU/HxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717542997; c=relaxed/simple; bh=Uq4EvBE43Ls9FjiY64JJfAUXK/Z8L+xBloyLZ6j0o3A=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=L8v5qWNSt1b1j1ZcXIZxA7pwDueJNsNs4bzROZJvENzsIu3XLjv0MhaDp513+iKlDBqm1XQhTXJTn/lBYsSHNMzpgJEe71sLZ1bceOxjxigvwboRVljY4cEW78Ar5fF/nlmOTgnILMUQ7+E6ItQVD/nS+/3gysF4/uW/zOQVUSk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QX7AxJf7; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QX7AxJf7" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-702442afa7dso4080869b3a.2 for ; Tue, 04 Jun 2024 16:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717542995; x=1718147795; darn=vger.kernel.org; h=content-disposition:mime-version:reply-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=txSNnaaUTRW26/z2nDdNpXI7SxmEqIlx5R3jWxZeE3k=; b=QX7AxJf7Lwv6ITOn8fB/pRpleLgUJoFuHhNO3dq9EAc1zi+C40pqt3TY2gUxeVa9mD 7cLpvKuuIYXy1nWlj9tygkHSdHiz3nwju2Np9ELIm4CITIqJrrFui7Uw8bpItc8XHD37 fP9OJWcvp6If6nk7TfWct8FjWUwesb6xhKCRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717542995; x=1718147795; h=content-disposition:mime-version:reply-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=txSNnaaUTRW26/z2nDdNpXI7SxmEqIlx5R3jWxZeE3k=; b=Vk2GyDCogkRv/GTUnpNhzHOhdBFcKmCWMyDO9PxUd5na2pqmvrIE1BTwgSZsV58VJJ fLS5MKGhwYDVJ7ZfF9XSY9/+yi0qV56ZRSM/efVnMI37OM/jsUcbjft3otYMTFNyCnXX 5TwhVzaH68EoDx9BJqeUv5SaGlbFeO7sfXabIelXESsLr/+AIYeMyqDI/YReh64VxwUI /vgSSXbmstkhgg4KDggnYX0t+65/dmsNgmi0dSgALhlcqxqMMLU4gi/tvXX+H13W/on8 lE1RWGHL6ysgd7gWqNZAiLO1m69oHtX4ZaHrvHxGylZM4xvTnbWb0Nh7KJzaTIuNtldR 7Ryg== X-Forwarded-Encrypted: i=1; AJvYcCWOaWIF51nn8+OxiKEl7WtaOVGSG0oOSpWKPdMHGxKV9yu5cq7FICjSLx5iH5D+9sqdbw1GwWuQ1u/t+njMEyvhmcOUiKLEDZaVJSY= X-Gm-Message-State: AOJu0YyzEQYJVClZ0WCBkmzIgtSBLjZyb0G9l4zlZ6lMlMnQ6oUl8HlD I2lerG9tf7XZQc/WgcvlZP7WOmTJ7YmJW1cwrsFplwxnT8JkZx6junHovBqhlPhV16x1DMUQQZU = X-Google-Smtp-Source: AGHT+IFhPl7aj3AkQk9zUjDMLf84f4x6eeLytaleRwOat2vwUHfqeBZiEIJtBIpDhKTb/FkDcjvWMA== X-Received: by 2002:a05:6a21:6d9a:b0:1af:dd77:86ab with SMTP id adf61e73a8af0-1b2b715e5b8mr1242179637.54.1717542994813; Tue, 04 Jun 2024 16:16:34 -0700 (PDT) Received: from google.com ([2620:15c:9d:200:72e1:5805:701a:f116]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-702423dbf2csm7529291b3a.51.2024.06.04.16.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 16:16:34 -0700 (PDT) Date: Tue, 4 Jun 2024 23:16:32 +0000 From: Aseda Aboagye To: Jiri Kosina Cc: Benjamin Tissoires , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH v4 2/2] input: Add support for "Do Not Disturb" Message-ID: Reply-To: Zl-e97O9nvudco5z@google.com Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline 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 --- Changes from v3: - Fixed patch sending workflow to not muck with whitespace. Changes from v2: - Added underscores to make `KEY_DO_NOT_DISTURB`. Changes from v1: - Modified formatting to match existing code, ignoring checkpatch.pl. 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 7749c81b6227..4ccfbd860bbe 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 1ecc5ad57b56..31feb5e0714f 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -826,6 +826,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 7ff6eeef1af0..07038fd9682d 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -618,6 +618,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 */