Message ID | 20221029120311.11152-3-erayorcunus@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1315604wru; Sat, 29 Oct 2022 05:08:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QA7Ap/huTq5Y3XDVOdMVh0yJjaOkeBZdrau+X8WGGm2adfUPBUYYtUgtLdQeD/LaAw43C X-Received: by 2002:a05:6402:5291:b0:45c:3f6a:d4bc with SMTP id en17-20020a056402529100b0045c3f6ad4bcmr4022636edb.285.1667045285218; Sat, 29 Oct 2022 05:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667045285; cv=none; d=google.com; s=arc-20160816; b=tBX14kl9I/ME1URQDcjqfZyQMpLUkbfI2tT7BbN//ZLRfLDvcu/vA8859BXgqBReCa ZTPDlDKV6D57TTNf7ZDggj6bWqNHvxe//9rBYjXkEp9ZPyp3HYpx0iZ3JogtBDhTh/Xi YokXA4E0uKydWWVdIBIp1zX/Zxcop5jvc9syOMKNioRhkytB6GiPoBrXXF92BDHmyB1K L+EoNGEHBoTV/6lW9zxH/jNf/QHtE+tj6T6K8B2xZ4EJpSr0GcKGhr5e45fVOp6XNrF7 6Ur7PQpjf6vbzP6agq2VG45nyWp9uecRah9qFQ1HquB3lRTpVJexyiViMdzFE/G574nY MBrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Bb6ASl23RrFIKXOSlIN+mXfWnuBP94uLLqr0AkpKDA=; b=L1lmfpJytkaSOKRFYrYD/gVa2K5+bKzqRUzSr4eiwhdErjrSifkabws93HSd0paJlA LOnnWOkxA1YH4WUA1K9t+tR9ZN7Yyn5XoUS7t7I+ORScmqXnVbiVbcbXPjhXoEcVRMgq 8vECV9cdrXhkdfXG/hXfvkh5cgbDjDa3UTZf1tTS/xwA7blwHXrscp4qyPd4t6ZaUbf+ sFvjxaSVCymdXyqQaVnDnTbsY+CAhdOmTFJiiHaRy0ePVJhKCf95L0ChGQEaK+9KZKYE O0cdzctEIz4+/R33jO5WstoUEQ/xtweMICl7wcQsAD9/LHNF7RkKa1ojEXBN5wNVgGM2 Xwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UKY4lfhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020aa7d655000000b0045a11b60c57si1483460edr.121.2022.10.29.05.07.41; Sat, 29 Oct 2022 05:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UKY4lfhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiJ2MEe (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sat, 29 Oct 2022 08:04:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiJ2ME3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 29 Oct 2022 08:04:29 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38F1F315; Sat, 29 Oct 2022 05:04:27 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id c7-20020a05600c0ac700b003c6cad86f38so8033512wmr.2; Sat, 29 Oct 2022 05:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Bb6ASl23RrFIKXOSlIN+mXfWnuBP94uLLqr0AkpKDA=; b=UKY4lfhgMvDyzlpHGK828TVKM8bLmKYfTAbbSosf7Z9b84uk2IIBBGreNKB7zsd0Oe YhsjFdEHsTFBOH9hvI5wWplfWVVRKTdlg3VdEkA+rkxHnzl7ZwQcCdinB/clMYnxXFRP W7lTS0jxMLMzV0kIVLxjSNXsLxW1ckwMdyP/zWsBOXOJXEA8UElXeqTB5wWzzie+1rVm bPV6gcn2brP9Cg+2I83F4U/IV5o10Krrqv8ZY9eng4gOYGNRBjk3621/sLepeXIthPDE 0EHXPhsmdSFBK0nXg/5SsuNUk2hkYFjhM8vWD82cJU/l9T6WUBrdkoyvl4qjKgz14Oci sJUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Bb6ASl23RrFIKXOSlIN+mXfWnuBP94uLLqr0AkpKDA=; b=Hu7DAdn4GRI9napf+xc7pHBP5EICA/9c3V42/9/6sM8GCPcRoxvlBMKzhYR1hb4Ttc mnKswA8ECsF+v5QQuGn66FzjiTHejzMRU/d9R/E8LN/DwEkrC3vTqc/XiZbpq3uWDAnB qkArHTPgkwCVULz+3Kmk015CZA+0ZWFyzJywyK5TXJDTNmElVv4F8SDiTOAuIbu3Yj4I onF/X8GZC527zqTeMd0aCMTtie4M8T/YF/DOkRFXU3n+3Po8Tw2xHgLTBYVe94QzCAQ9 tW3nwXtu5VOUrxS7JqGLBt5j4ZLdIpc7rgWmTSaWiuyMH1aoAkSYJrhBOlbxpkT0QorX zo2Q== X-Gm-Message-State: ACrzQf1vGmpjmbZ2xBkeuEHfjx1eonkVjWkT+ymEkd0iHBcd8kZFGX3S TJEP8BN74MgyBBsTmz9bcW9qgkJB9OEkWA== X-Received: by 2002:a05:600c:1da7:b0:3ce:a1:f961 with SMTP id p39-20020a05600c1da700b003ce00a1f961mr12107085wms.175.1667045065486; Sat, 29 Oct 2022 05:04:25 -0700 (PDT) Received: from eray-Lenovo-Z50-70.. ([188.132.247.187]) by smtp.googlemail.com with ESMTPSA id z17-20020a05600c0a1100b003b492753826sm1472439wmp.43.2022.10.29.05.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 05:04:25 -0700 (PDT) From: =?utf-8?q?Eray_Or=C3=A7unus?= <erayorcunus@gmail.com> To: platform-driver-x86@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, ike.pan@canonical.com, jikos@kernel.org, benjamin.tissoires@redhat.com, dmitry.torokhov@gmail.com, hdegoede@redhat.com, mgross@linux.intel.com, pobrn@protonmail.com, =?utf-8?q?Eray_Or=C3=A7unus?= <erayorcunus@gmail.com> Subject: [PATCH v2 2/7] HID: add mapping for camera access keys Date: Sat, 29 Oct 2022 15:03:07 +0300 Message-Id: <20221029120311.11152-3-erayorcunus@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221029120311.11152-1-erayorcunus@gmail.com> References: <20221029120311.11152-1-erayorcunus@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748023676797369381?= X-GMAIL-MSGID: =?utf-8?q?1748023676797369381?= |
Series |
Add camera access keys, IdeaPad driver improvements
|
|
Commit Message
Eray Orçunus
Oct. 29, 2022, 12:03 p.m. UTC
HUTRR72 added 3 new usage codes for keys that are supposed to enable, disable and toggle camera access. These are useful, considering many laptops today have key(s) for toggling access to camera. This patch adds new key definitions for KEY_CAMERA_ACCESS_ENABLE, KEY_CAMERA_ACCESS_DISABLE and KEY_CAMERA_ACCESS_TOGGLE. Additionally hid-debug is adjusted to recognize this new usage codes as well. Signed-off-by: Eray Orçunus <erayorcunus@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/hid/hid-debug.c | 3 +++ drivers/hid/hid-input.c | 3 +++ include/uapi/linux/input-event-codes.h | 3 +++ 3 files changed, 9 insertions(+)
Comments
On Sat, 29 Oct 2022, Eray Orçunus wrote: > HUTRR72 added 3 new usage codes for keys that are supposed to enable, > disable and toggle camera access. These are useful, considering many > laptops today have key(s) for toggling access to camera. > > This patch adds new key definitions for KEY_CAMERA_ACCESS_ENABLE, > KEY_CAMERA_ACCESS_DISABLE and KEY_CAMERA_ACCESS_TOGGLE. Additionally > hid-debug is adjusted to recognize this new usage codes as well. > > Signed-off-by: Eray Orçunus <erayorcunus@gmail.com> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz>
Hi Dmitry, On 10/29/22 14:03, Eray Orçunus wrote: > HUTRR72 added 3 new usage codes for keys that are supposed to enable, > disable and toggle camera access. These are useful, considering many > laptops today have key(s) for toggling access to camera. > > This patch adds new key definitions for KEY_CAMERA_ACCESS_ENABLE, > KEY_CAMERA_ACCESS_DISABLE and KEY_CAMERA_ACCESS_TOGGLE. Additionally > hid-debug is adjusted to recognize this new usage codes as well. > > Signed-off-by: Eray Orçunus <erayorcunus@gmail.com> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> I have rejected the drivers/platform/x86 patch which depends on this, because it changes current behavior, potentially breaking userspace. Since this means I won't be taking any patches depending on this I believe it is best if this is merged through the input tree. Note this also has a: Acked-by: Jiri Kosina <jkosina@suse.cz> tag given in this email thread. Regards, Hans > --- > drivers/hid/hid-debug.c | 3 +++ > drivers/hid/hid-input.c | 3 +++ > include/uapi/linux/input-event-codes.h | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c > index f48d3534e020..991f880fdbd4 100644 > --- a/drivers/hid/hid-debug.c > +++ b/drivers/hid/hid-debug.c > @@ -936,6 +936,9 @@ static const char *keys[KEY_MAX + 1] = { > [KEY_ASSISTANT] = "Assistant", > [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext", > [KEY_EMOJI_PICKER] = "EmojiPicker", > + [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", > + [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", > + [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", > [KEY_DICTATE] = "Dictate", > [KEY_BRIGHTNESS_MIN] = "BrightnessMin", > [KEY_BRIGHTNESS_MAX] = "BrightnessMax", > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c > index f197aed6444a..f8e6513e77b8 100644 > --- a/drivers/hid/hid-input.c > +++ b/drivers/hid/hid-input.c > @@ -995,6 +995,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel > case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; > case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; > > + case 0x0d5: map_key_clear(KEY_CAMERA_ACCESS_ENABLE); break; > + case 0x0d6: map_key_clear(KEY_CAMERA_ACCESS_DISABLE); break; > + case 0x0d7: map_key_clear(KEY_CAMERA_ACCESS_TOGGLE); break; > case 0x0d8: map_key_clear(KEY_DICTATE); break; > case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break; > > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h > index 7989d9483ea7..ef392d0f943f 100644 > --- a/include/uapi/linux/input-event-codes.h > +++ b/include/uapi/linux/input-event-codes.h > @@ -614,6 +614,9 @@ > #define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ > #define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */ > #define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */ > +#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_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ > #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
On Tue, Nov 15, 2022 at 09:33:49PM +0100, Hans de Goede wrote: > Hi Dmitry, > > On 10/29/22 14:03, Eray Orçunus wrote: > > HUTRR72 added 3 new usage codes for keys that are supposed to enable, > > disable and toggle camera access. These are useful, considering many > > laptops today have key(s) for toggling access to camera. > > > > This patch adds new key definitions for KEY_CAMERA_ACCESS_ENABLE, > > KEY_CAMERA_ACCESS_DISABLE and KEY_CAMERA_ACCESS_TOGGLE. Additionally > > hid-debug is adjusted to recognize this new usage codes as well. > > > > Signed-off-by: Eray Orçunus <erayorcunus@gmail.com> > > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > I have rejected the drivers/platform/x86 patch which depends > on this, because it changes current behavior, potentially > breaking userspace. > > Since this means I won't be taking any patches depending on > this I believe it is best if this is merged through the input tree. > > Note this also has a: > > Acked-by: Jiri Kosina <jkosina@suse.cz> > > tag given in this email thread. OK, I picked it up. Thanks.
Hi Eray, On Sat, Oct 29, 2022 at 5:04 AM Eray Orçunus <erayorcunus@gmail.com> wrote: > > HUTRR72 added 3 new usage codes for keys that are supposed to enable, > disable and toggle camera access. These are useful, considering many > laptops today have key(s) for toggling access to camera. > > This patch adds new key definitions for KEY_CAMERA_ACCESS_ENABLE, > KEY_CAMERA_ACCESS_DISABLE and KEY_CAMERA_ACCESS_TOGGLE. Additionally > hid-debug is adjusted to recognize this new usage codes as well. > > Signed-off-by: Eray Orçunus <erayorcunus@gmail.com> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > drivers/hid/hid-debug.c | 3 +++ > drivers/hid/hid-input.c | 3 +++ > include/uapi/linux/input-event-codes.h | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c > index f48d3534e020..991f880fdbd4 100644 > --- a/drivers/hid/hid-debug.c > +++ b/drivers/hid/hid-debug.c > @@ -936,6 +936,9 @@ static const char *keys[KEY_MAX + 1] = { > [KEY_ASSISTANT] = "Assistant", > [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext", > [KEY_EMOJI_PICKER] = "EmojiPicker", > + [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", > + [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", > + [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", > [KEY_DICTATE] = "Dictate", > [KEY_BRIGHTNESS_MIN] = "BrightnessMin", > [KEY_BRIGHTNESS_MAX] = "BrightnessMax", > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c > index f197aed6444a..f8e6513e77b8 100644 > --- a/drivers/hid/hid-input.c > +++ b/drivers/hid/hid-input.c > @@ -995,6 +995,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel > case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; > case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; > > + case 0x0d5: map_key_clear(KEY_CAMERA_ACCESS_ENABLE); break; > + case 0x0d6: map_key_clear(KEY_CAMERA_ACCESS_DISABLE); break; > + case 0x0d7: map_key_clear(KEY_CAMERA_ACCESS_TOGGLE); break; I was looking at the HID Usages table spec and it came to my attention that HUTRR72 actually established 0x76, 0x77 and 0x78 as the usages for then new camera access controls: https://www.usb.org/sites/default/files/hutrr72_-_usages_to_control_camera_access_0.pdf Where did 0xd5, 0xd6 and 0xd7 came from? It looks like we need to update the hid-input mappings as the are clashing with game recording controls from HUTRR64: https://www.usb.org/sites/default/files/hutrr64b_-_game_recording_controllers_0.pdf Thanks.
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index f48d3534e020..991f880fdbd4 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -936,6 +936,9 @@ static const char *keys[KEY_MAX + 1] = { [KEY_ASSISTANT] = "Assistant", [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext", [KEY_EMOJI_PICKER] = "EmojiPicker", + [KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable", + [KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable", + [KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle", [KEY_DICTATE] = "Dictate", [KEY_BRIGHTNESS_MIN] = "BrightnessMin", [KEY_BRIGHTNESS_MAX] = "BrightnessMax", diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index f197aed6444a..f8e6513e77b8 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -995,6 +995,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; + case 0x0d5: map_key_clear(KEY_CAMERA_ACCESS_ENABLE); break; + case 0x0d6: map_key_clear(KEY_CAMERA_ACCESS_DISABLE); break; + case 0x0d7: map_key_clear(KEY_CAMERA_ACCESS_TOGGLE); break; case 0x0d8: map_key_clear(KEY_DICTATE); break; case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break; diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 7989d9483ea7..ef392d0f943f 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -614,6 +614,9 @@ #define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ #define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */ #define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */ +#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_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */