Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp631393imm; Tue, 15 May 2018 06:58:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpwTqOESaaVw5H3p9Qkzjd6sxBW82OXe2qpVv0tRSWFuzLG2G26zn5bOR+k2ce2wQbD+DWm X-Received: by 2002:a17:902:8a8c:: with SMTP id p12-v6mr14230204plo.94.1526392694202; Tue, 15 May 2018 06:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526392694; cv=none; d=google.com; s=arc-20160816; b=hZMjHdtk/81MhF0DJBelEh2gx776Q5RSCNa66SMuDJMC/FbRIsTXjySVuexiaTflWi wnANwtqPCQ2cKvVa59SPl+JGljT1A7D9Ok3snKRNf51lwTtVQrweJ2YoEhmLmxmj1zXf ybjZ73CxzOwkf5dN+tk02PxRlFI20uRFHzJMrKtSnDoCSmT3l4oYOnUSAqHRIee3UrcY JuWgc5HRSyBmgiXC5isGjBSOvh9L+nqHsD2Vv/LnofFqGWj5rpClIL3oDzC32arzelzD jNtgAZnBGymrgW34NykI2LLx02TGHFGifBLplxw9RXrgWPTVH3NYNdqyI3RSPe3sZkJc oL2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=RCTzkJwfG6UbzyPQOIb1VWIzcxBeXzEl6QivXTLcDfk=; b=QObzlKpoU37rpJIyXtFGN24fmJMxC2h28ad3zNhKuSBo6XIkY2YM3wPEiwoFSG/EgS +0cmU3MyGYHpB4nVR31e+gYoeqCp0c3jRA5EYihNW/XISzwL3lCZjAvhBTO3m0PMJshT FSR19oe6ixT8UovBJm7ORh263TuzYzZTQieTX+ods9nI76hF06pNLLupj08vgA0DtODj r71HNZgLPg+9Z8CJo9qE+LK84MdotFXnnx8WEWQdTZ/I4Lt3Wm/bAQYzaYpk0/HM0BDo iYfpbZ1AAaAon52Igd1pJo/DhdbyAqLb0gtDrgCB+1nt1d9csXcK9q5Klxrawz2i2+yQ XemQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13-v6si117530plt.142.2018.05.15.06.57.58; Tue, 15 May 2018 06:58:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561AbeEONl1 (ORCPT + 99 others); Tue, 15 May 2018 09:41:27 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40250 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753542AbeEONlX (ORCPT ); Tue, 15 May 2018 09:41:23 -0400 Received: by mail-wr0-f194.google.com with SMTP id v60-v6so189348wrc.7 for ; Tue, 15 May 2018 06:41:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=RCTzkJwfG6UbzyPQOIb1VWIzcxBeXzEl6QivXTLcDfk=; b=kiAvzoEJ+v5zojWqR3Y17zFFT7ptC3l1vNm/K044q/QIh7GEAUnZdn2Fo/ltUtpJzw fXN7N5fMh61p9bFCqImzj76FInKcpsdvsfbaM769/ASmhV8b2TB8xVNOnlwAeYBupWYm JhYG6eoouoeYlFL2FH1q4vMbUeAjCVyX854m52+Pm4Hul9YrpS2oVp/iUfT35mKrhoif X+H+S6AQfxdv5ch6lkkgJOs/MIvkiSC0sX1PTTvxgjWnxeqVOkCZJbaa2nxPVkUzvTtC Spz1akPKvPt0tBJYqESPugb5gk6CtehcyLD2PsLcNSrBZAHcS4g55z0zt/DyT1EO8cs2 3mHQ== X-Gm-Message-State: ALKqPwcrvhZKM4tdVDWIK5fhWu8kjYbcS0HOBNzLirPQLSP5F5QYKnku Q0d+wyFS57QNHoEZnuzOXpQWaA== X-Received: by 2002:adf:a512:: with SMTP id i18-v6mr11784068wrb.155.1526391682319; Tue, 15 May 2018 06:41:22 -0700 (PDT) Received: from ben-x1.lan (p5480126C.dip0.t-ipconnect.de. [84.128.18.108]) by smtp.gmail.com with ESMTPSA id x63-v6sm704400wma.25.2018.05.15.06.41.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 06:41:21 -0700 (PDT) Message-ID: Subject: Re: [PATCH v2] platform/x86: asus-wmi: Add keyboard backlight toggle support From: Benjamin Berg To: Daniel Drake , Andy Shevchenko Cc: Chris Chiu , Corentin Chary , Darren Hart , Andy Shevchenko , acpi4asus-user , Platform Driver , Linux Kernel Mailing List , Linux Upstreaming Team , Jian-Hong Pan Date: Tue, 15 May 2018 15:41:18 +0200 In-Reply-To: References: <20180503030438.51150-1-chiu@endlessm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.2 (3.28.2-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi Daniel, I had a quick chat with Bastien about this. The conclusion was that reusing the TOGGLE key may be problematic for gnome-settings-daemon. And the alternative of a new CYCLE key also has some caveats. The most straight forward solution is likely to simply handle the brightness change in the kernel and not report the key to userspace at all. This should work just fine and at least GNOME will show an on screen display in response to the brightness change. Do you think that approach would work well? Benjamin On Mon, 2018-05-14 at 18:25 -0600, Daniel Drake wrote: > Hi Andy, > > On Mon, May 7, 2018 at 8:46 AM, Daniel Drake > wrote: > > > > Some Asus laptops like UX550GE has hotkey (Fn+F7) for keyboard > > > > backlight toggle. In this UX550GE, the hotkey incremet the > > > > level > > > > of brightness for each keypress from 1 to 3, and then switch it > > > > off when the brightness has been the max. This commit > > > > interprets > > > > the code 0xc7 generated from hotkey to KEY_KBDILLUMUP to > > > > increment > > > > the brightness, then pass KEY_KBDILLUMTOGGLE to user space > > > > after > > > > the brightness max been reached for switching the led off. > > > > > > > > > > Pushed to my review and testing queue, thanks! > > > > We found that GNOME's handling of the toggle key is somewhat > > imperfect > > and it will need modifying before we achieve the > > Up-Up-Up-off-Up-Up-Up-off... cycle that we are looking for. > > > > https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/41 > > > > In that discussion an alternative perspective was raised: > > > > Is it right for the kernel to modify the key sent to userspace, > > when > > it is then relying on the specific userspace action of it changing > > the > > brightness to the next expected level? (and this userspace > > behaviour > > is not even working right in the GNOME case) > > > > Instead, would it make sense for the kernel to always report TOGGLE > > in > > this case, and for GNOME to interpret toggle as simply "cycle > > through > > all the available brightness levels"? > > Any comments on this? I am tempted to send a patch to just make this > key always emit TOGGLE from the kernel given that we have a tentative > agreement on implementing the brightness cycle within GNOME. > > Daniel -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEED2NO4vMS33W8E4AFq6ZWhpmFY3AFAlr6434ACgkQq6ZWhpmF Y3D97A/9Hqi/xvHU5jcgtKQ2AH3pN445whjXrnUPpcN3I6zgeo/2kXHxn+DEFzD/ xsBLRy2hzfvw5HXWsclf8u31TajmP9OOihHTMB+Ng7ZJohIEgwPjIMr/eaHiiLYr W9aamm/5DJF5cwYXmiQ46+y+Wbc5ZJbu0wSgiMDY2uEhlph/9J3NGRadb6xEWJX+ Rrp2te5lqwIvHKv4tF/HOrXev6R77AdpHy+WYrA1IKdG996kFDAZcLErk5EL/J0U +p+pkGbul/JHKcwU77L/Sg8daM1GMQfxWKbR9k21Fow27iaJRMn9Vn9s8HEmHJ+5 S8cBIo71EjNHXO2oDaSzI9Ng1q+Zy7XjHtbK8/MmauQ/3n/z3tt8ZkW4/FumdMkm ZZwmS9OxOTc+G9hc3SLkggRF1ygbaCgsZaynyEiBHSq37V0G9WBL6BaDW9P6jEIV 7aPJN6SEBLqXStBZiwNXn/yr1AC7duhnIvzxYZj/SUdCk18aDS/tGIehGTqTumGV 2jhyHQek2fp7J0AZH8oOnU9rAIdKtPb3vf5DJuCOD2TtB/yMZDJVj1Uc1g565IPs KcVdMdiqTy7m65BAwjJyrFu04GIi02SBFFEsdKGOkAcuPPWpG+4EnUwGpArwxwYv SaUnUD4DRvsoyZHeXETsa7ePh9aBZwmNR+AGSoLj8UY+vbh3/dg= =szZs -----END PGP SIGNATURE-----