Message ID | 20221029120311.11152-1-erayorcunus@gmail.com |
---|---|
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 l7csp1315373wru; Sat, 29 Oct 2022 05:07:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Sf3YkPi76fCt4I1V0rLOLVeOgA1oX4GgZjjxEIEwi5nzb0il1T8yK4VS0lRBtBnfeJKjI X-Received: by 2002:aa7:dd45:0:b0:458:7474:1fbe with SMTP id o5-20020aa7dd45000000b0045874741fbemr4099651edw.334.1667045254141; Sat, 29 Oct 2022 05:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667045254; cv=none; d=google.com; s=arc-20160816; b=n5DBQY3m/rpEA9ySm95VIzhQhKFoL0N2heNyT9G+LA6cg8MsqeZbtAd4CfDw8eQpl/ 5G8XpGqKTLRHEGZ4ZgdHTKfyb0stYrSMNlhFnf9LAQgTsFpBc7atGcjlN3BL6yOjErI3 g5M9dA+4BCI0GdTxhGFY+C0/3DqYFxfrBe8Z7mmbDj2fdQ+XlJVBnhb4iJv1YeJmWDwV kFuo/LgmKRXKd3VUDeLAaRAwatQGIfSoZ9ZZGWguAx0yu5AEbvVWHPk3Cihntg9ss4pL YKk5DoSi5uhDQmRw6eYj9s7lpvTdYJfKGKUEJWtkvafGGUo3OnRz2Nt5OiReZw+6sCuZ hY7Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ym++Yr1RANQjZT5Dn6yHeaV4FACrpo9YTFn69L+Enh8=; b=pW2R9K82wgDjsgFvnkpbzLCGeqV1++sCmQfOHqhy3U1QBkX0tw4PkIaxKIC+riy+D8 S3zoJvKvFAJVoTaPblUNWAWePJPqlF4PmwV0kwuoB6Qtdpyau08VRRFBSEdlyApMWqbK yUrGa0uSGNuf4Seb6ymIxiwK1LqXc64p+uN8APF+GdD9O04H0KYpI/Z8oxSlQk/0C8Gh Wbdp+esIqnMitMA1oMfFuILecF2o3qWIRKc3l1CgQtkAxmKGBPxh/oq4NF0RwjZgYL6b Sh87hTjjkHkK5ZmxzuQmP9lMMktshDbGFu3LZlQhPdv1aJ1KCQBMC2yzW4HeKhY5FQad mLtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QXMOjfGh; 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 l19-20020a170906795300b0077ef2f9c8b7si1646411ejo.922.2022.10.29.05.07.09; Sat, 29 Oct 2022 05:07:34 -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=QXMOjfGh; 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 S229782AbiJ2MEW (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sat, 29 Oct 2022 08:04:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiJ2MEU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 29 Oct 2022 08:04:20 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B87748E0; Sat, 29 Oct 2022 05:04:19 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id bs21so9719985wrb.4; Sat, 29 Oct 2022 05:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ym++Yr1RANQjZT5Dn6yHeaV4FACrpo9YTFn69L+Enh8=; b=QXMOjfGhEpdMNZo0kR9PJngxq2Pmha+ffBPgIGkJVREcHLGf6RXkIv9+qMvi3NluLB XHhFTwZa/pY7CNAZPqxy80FGf9t8KMRddVAy/1suRdzyKNcisz3IFqsSb7fDNMO7dveQ pqDNU5ljR0eMm/0ovmyyf11rmY/uZBHQqhGVT4ISi2kyXMMKcihpcAwu+LrigktoSJcu WhH1pzjuBaR6Lk5wNy4Uu7ORcqJdcAFgBAo4u8nYKJexzH0xnbJcjagXz7HZAYtyaAEY /aGYGZvJ+Q14+V6GqHEUfPkyBv9QmyvRLL5p1CKPydIy9Zjd6qzBRxIB9DaNUEE7EeoQ A2pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ym++Yr1RANQjZT5Dn6yHeaV4FACrpo9YTFn69L+Enh8=; b=lso361JemLgQXZjJ2VdRRR1gS95P4c8jW/JDk2ls3WOW7c//souirqo6k/lUD/+1EC RLaVzlF0i2A0A/uP0fc7AHui/S9x1KLjzrQt76HCDhErosa9maov4PsvEdJrHyXTE+vL cBR3xhL69fC59BUJrDdweMgS6j0JS0EBA+/DxWSoxm4VZr0MAl1tCY+nJec1osgNCluR OQcYZdIltNEinNOiQajkHQdI/qRZPsE76uIwRSzlxU3F5fP+3qCQZQecJlt2jJffzffW Uzv8Vpukvj9aSLQnylKtxVRgIsEKjFQ7VOaKqLLvzQtAgYmIVGODsgo+R5K4uZxQgzxr nztw== X-Gm-Message-State: ACrzQf3+zJfvwcWNil0OFvLfOsxZOYKnBm0z26o+1u2OqGqDZtnrPthR nevB8RVJUk7lZ0hOE9Tx9LNucRPwevhS+A== X-Received: by 2002:adf:dc4a:0:b0:236:5ba2:df2b with SMTP id m10-20020adfdc4a000000b002365ba2df2bmr2224530wrj.260.1667045057287; Sat, 29 Oct 2022 05:04:17 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 05:04:16 -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 0/7] Add camera access keys, IdeaPad driver improvements Date: Sat, 29 Oct 2022 15:03:05 +0300 Message-Id: <20221029120311.11152-1-erayorcunus@gmail.com> X-Mailer: git-send-email 2.34.1 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?1748023644319633899?= X-GMAIL-MSGID: =?utf-8?q?1748023644319633899?= |
Series |
Add camera access keys, IdeaPad driver improvements
|
|
Message
Eray Orçunus
Oct. 29, 2022, 12:03 p.m. UTC
Nowadays many laptops have camera access keys, yet there is no usage codes mapped to them, even though it's introduced in HUTRR72. Start point of this patch series was adding it and making IdeaPads send it to userspace. But later I discovered that camera_power attribute of ideapad-laptop driver on my IdeaPad 520-15IKB doesn't work, so I can't toggle it with that. I managed to find a way to check whether an IdeaPad supports camera_power attribute (which sends VPCCMD_W_CAMERA to EC), don't expose it to sysfs so userspace will know that it can't toggle camera access via camera_power, in my case, after receiving KEY_CAMERA_ACCESS_TOGGLE. Along the way I discovered that old IdeaPads, like S10-3, may not be able to toggle their touchpad as a regression of a commit aimed for newer IdeaPads, so I reverted it. Also I noticed that I can get/set the state of my keyboard light, so one of the patches also adds supports for this kind of keyboard lights, which I call "partially supported keyboard lights". I expect that commit to add keyboard light support for 520-15IKB, 330-17ICH, 5 (15) and more. Currently only tested on 520-15IKB. --- Changes in v2: - Added Dmitry Torokhov's Acked-By to patch 2 - Applied Barnabás Pőcze's recommendations to patch 5: - strncmp -> strstarts - static global "CAM" string -> inlined "CAM" string - move new variables to the scope they're used, and order them - Added patch 7, which removes "touchpad" attr for SYNA2B33 Eray Orçunus (7): Revert "platform/x86: ideapad-laptop: check for touchpad support in _CFG" HID: add mapping for camera access keys platform/x86: ideapad-laptop: Report KEY_CAMERA_ACCESS_TOGGLE instead of KEY_CAMERA platform/x86: ideapad-laptop: Add new _CFG bit numbers for future use platform/x86: ideapad-laptop: Expose camera_power only if supported platform/x86: ideapad-laptop: Keyboard backlight support for more IdeaPads platform/x86: ideapad-laptop: Don't expose touchpad attr on IdeaPads with SYNA2B33 drivers/hid/hid-debug.c | 3 + drivers/hid/hid-input.c | 3 + drivers/platform/x86/ideapad-laptop.c | 170 ++++++++++++++++++++++--- include/uapi/linux/input-event-codes.h | 3 + 4 files changed, 162 insertions(+), 17 deletions(-) base-commit: d9db04c1dec6189413701c52b9498a7a56c96445
Comments
On 10/29/22 20:03, Eray Orçunus wrote: > Nowadays many laptops have camera access keys, yet there is no usage codes > mapped to them, even though it's introduced in HUTRR72. Start point of > this patch series was adding it and making IdeaPads send it to userspace. > But later I discovered that camera_power attribute of ideapad-laptop > driver on my IdeaPad 520-15IKB doesn't work, so I can't toggle it with > that. I managed to find a way to check whether an IdeaPad supports > camera_power attribute (which sends VPCCMD_W_CAMERA to EC), don't expose > it to sysfs so userspace will know that it can't toggle camera access via > camera_power, in my case, after receiving KEY_CAMERA_ACCESS_TOGGLE. > > Along the way I discovered that old IdeaPads, like S10-3, may not be able > to toggle their touchpad as a regression of a commit aimed for newer > IdeaPads, so I reverted it. > > Also I noticed that I can get/set the state of my keyboard light, > so one of the patches also adds supports for this kind of keyboard lights, > which I call "partially supported keyboard lights". I expect that commit > to add keyboard light support for 520-15IKB, 330-17ICH, 5 (15) and more. > Currently only tested on 520-15IKB. Thanks. Also test on my ideapad s410 and it looks good. Acked-by: Ike Panhc <ike.pan@canonical.com>
On 11/08/22 06:56, Ike Panhc wrote: > On 10/29/22 20:03, Eray Orçunus wrote: > > Nowadays many laptops have camera access keys, yet there is no usage codes > > mapped to them, even though it's introduced in HUTRR72. Start point of > > this patch series was adding it and making IdeaPads send it to userspace. > > But later I discovered that camera_power attribute of ideapad-laptop > > driver on my IdeaPad 520-15IKB doesn't work, so I can't toggle it with > > that. I managed to find a way to check whether an IdeaPad supports > > camera_power attribute (which sends VPCCMD_W_CAMERA to EC), don't expose > > it to sysfs so userspace will know that it can't toggle camera access via > > camera_power, in my case, after receiving KEY_CAMERA_ACCESS_TOGGLE. > > > > Along the way I discovered that old IdeaPads, like S10-3, may not be able > > to toggle their touchpad as a regression of a commit aimed for newer > > IdeaPads, so I reverted it. > > > > Also I noticed that I can get/set the state of my keyboard light, > > so one of the patches also adds supports for this kind of keyboard lights, > > which I call "partially supported keyboard lights". I expect that commit > > to add keyboard light support for 520-15IKB, 330-17ICH, 5 (15) and more. > > Currently only tested on 520-15IKB. > > Thanks. Also test on my ideapad s410 and it looks good. > > Acked-by: Ike Panhc <ike.pan@canonical.com> Thank you :) I need some advice since I'm new in here, sadly another patch has been merged to ideapad-laptop along the way and currently it's not possible to merge patch #7, does that mean I should send v3 of my patch series? And whom should I wait for merge, x86 platform drivers maintainers? I think that is the only subsystem whose maintainers haven't replied yet. -eray
Hi Eray, Sorry for the long silence, I have not done any pdx86 patch review the last 2 weeks due to personal circumstances. On 11/9/22 13:58, Eray Orçunus wrote: > On 11/08/22 06:56, Ike Panhc wrote: >> On 10/29/22 20:03, Eray Orçunus wrote: >>> Nowadays many laptops have camera access keys, yet there is no usage codes >>> mapped to them, even though it's introduced in HUTRR72. Start point of >>> this patch series was adding it and making IdeaPads send it to userspace. >>> But later I discovered that camera_power attribute of ideapad-laptop >>> driver on my IdeaPad 520-15IKB doesn't work, so I can't toggle it with >>> that. I managed to find a way to check whether an IdeaPad supports >>> camera_power attribute (which sends VPCCMD_W_CAMERA to EC), don't expose >>> it to sysfs so userspace will know that it can't toggle camera access via >>> camera_power, in my case, after receiving KEY_CAMERA_ACCESS_TOGGLE. >>> >>> Along the way I discovered that old IdeaPads, like S10-3, may not be able >>> to toggle their touchpad as a regression of a commit aimed for newer >>> IdeaPads, so I reverted it. >>> >>> Also I noticed that I can get/set the state of my keyboard light, >>> so one of the patches also adds supports for this kind of keyboard lights, >>> which I call "partially supported keyboard lights". I expect that commit >>> to add keyboard light support for 520-15IKB, 330-17ICH, 5 (15) and more. >>> Currently only tested on 520-15IKB. >> >> Thanks. Also test on my ideapad s410 and it looks good. >> >> Acked-by: Ike Panhc <ike.pan@canonical.com> > > > Thank you :) > > I need some advice since I'm new in here, sadly another patch has been > merged to ideapad-laptop along the way and currently it's not possible to > merge patch #7, does that mean I should send v3 of my patch series? No that is not necessary, I can rework it to apply on top of the other patch. But TBH I think we really need to work on a different solution for the problem with the touchpad issues with ideapad-laptop we cannot just keep adding touchpad and/or DMI ids because the driver is breaking touchpad functionality left and right. I will send out an email after this one to all authors of recent patches which all do "priv->features.touchpad_ctrl_via_ec = 0" in some way. With a request to gather some more info of why exactly this is necessary and to see if we cannot come up with a more generic fix. > And whom should I wait for merge, x86 platform drivers maintainers? I'm the x86 platform drivers maintainer. I believe it makes sense to merge this series through the x86 platform drivers git tree. I need to coordinate the merging of patch 2/7 with wDmitry (the input subsystem maintainer) I'll send him an email about this. After that I can likely merge patches 2-6. For the touchpad patches I would first like to get a better handle on how to fix things more generic. Specifically patch 1/7 will cause priv->features.touchpad_ctrl_via_ec to get set to 1 on more models and since that is causing issues I don't think that is a good idea (even though the patch does make sense) and for 7/7 I hope to come up with something more generic. If you can run the tests from the touchpad mail soon that would really help! Note I do plan to send 7/7 out as a fix for 6.1 if we run out of time wrt coming up with a recent fix. Getting at least some fix out the door is also why I already merged the other patch using the DMI ids. > I think that is the only subsystem whose maintainers haven't replied yet. Correct, but I have replied now :) Regards, Hans
Hi! On 11/9/22 19:38, Hans de Goede wrote: > Hi Eray, > > Sorry for the long silence, I have not done any pdx86 patch review > the last 2 weeks due to personal circumstances. Oh, I wasn't even aware I had to wait for pdx86 review, and Ike Panhc just sent his Acked-By anyway, no problem at all. > On 11/9/22 13:58, Eray Orçunus wrote: > > On 11/08/22 06:56, Ike Panhc wrote: > >> > >> Thanks. Also test on my ideapad s410 and it looks good. > >> > >> Acked-by: Ike Panhc <ike.pan@canonical.com> > > > > > > Thank you :) > > > > I need some advice since I'm new in here, sadly another patch has been > > merged to ideapad-laptop along the way and currently it's not possible to > > merge patch #7, does that mean I should send v3 of my patch series? > > No that is not necessary, I can rework it to apply on top of the other > patch. Oh, that's great, thank you. > For the touchpad patches I would first like to get > a better handle on how to fix things more generic. > > Specifically patch 1/7 will cause priv->features.touchpad_ctrl_via_ec > to get set to 1 on more models and since that is causing issues > I don't think that is a good idea (even though the patch does > make sense) and for 7/7 I hope to come up with something > more generic. > > If you can run the tests from the touchpad mail soon that > would really help! That sounds great! I will try to help as much as I can. And yeah, I couldn't guess patch 1 can cause a regression on some IdeaPads. > > I think that is the only subsystem whose maintainers haven't replied yet. > > Correct, but I have replied now :) Hehe, this reply was very informative, thank you :) Best, Eray