Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp278707imm; Tue, 5 Jun 2018 19:50:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKehuDhq7oiurM/abWPh6TjYmko4kL6x1xDLIP3jZ5sbaNTaEthlrasaH65FvD9GuzjBtDm X-Received: by 2002:a63:9543:: with SMTP id t3-v6mr1019425pgn.77.1528253452020; Tue, 05 Jun 2018 19:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528253451; cv=none; d=google.com; s=arc-20160816; b=E/MuQ8w93JJgBnvmsmA2VeUqqvnUT97E9MaIrNJouChXKMwL3LGz05Cl7zOgRxIogo NTNXuWd89kpSdanVxF+gOLVLavEZH+upTWgTPu86XrOx1CszSdlfqEcwMtBs7xGRlYGh pqXvEoNZKAqBGJkfjP3ogt+mC6PRaCPIUBJDYfmWMmyIrxNj/8RGSTvCLEvOAqTNyugL +9DpQRnTUUhfwX8VyJ++M9SzozJ5jgz8hgWChauCjadnj00Aoi9SZLrYIT1dIziSMF5j +RrTEo0Cdtv+TCpIofacIf/sfdLg8fhlA0wLDIl1+8guwwVTeeeGzHsu92pVcOiEZPba 0+Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=uwq8/M2aLzWgGOP5US81C1T+0UYaharO+hUGYasz/qo=; b=CQdESdVN5nzEFYc/myfStxCqOUArIzRs8QdaReD4RObSitJz+g0jAWpvEko6Zy9wNc rzdJ11p6+nqRzw1cUJChKvLt1P4zD9pBeG06WvfMPasnqfuUuN5z62GSX4g12j9lULzb Y1cO98FTRCdfK8gY/Yz7mH0c4Ftt41rQ56GgLaAfSQotl2zuUnzLbkN/mxuM8U/Gu66e alPIiyQs4K3BE9X+esmqaEbOWgBaNk8Tjb7iSI2zgDIH6DbTuNlXrbM6zrO77nhAaoRY JxqF/QbxwGGCZUzsX1GwTvf2sHSrGddbKfOXK5/pquheJWjKs1k1PUSslJV6Gx25Ito5 84NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=qJ2BIImR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u22-v6si27133204pfg.62.2018.06.05.19.50.34; Tue, 05 Jun 2018 19:50:51 -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; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=qJ2BIImR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbeFFCuJ (ORCPT + 99 others); Tue, 5 Jun 2018 22:50:09 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54386 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752768AbeFFCuH (ORCPT ); Tue, 5 Jun 2018 22:50:07 -0400 Received: by mail-wm0-f66.google.com with SMTP id o13-v6so8554914wmf.4 for ; Tue, 05 Jun 2018 19:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uwq8/M2aLzWgGOP5US81C1T+0UYaharO+hUGYasz/qo=; b=qJ2BIImRjD3J67E2/39EIShN04P+N9zY8QIS/8am7W5qp+Aczr8p82XnmlM9RC1dIh mtDry3yDR2f8a4iMZCCDK6RVNpB41NRNIxGExk22Cfkf5RPyiqqepb3fHriRZKKCxsHz I5Fm9SoQqO48WtLt7OTvzE2bteORNOeR3SjzeoqPWmqZaFeEOc2zocRAkxG4bdp2kQY+ eSh6b41WIjQK3r0eNl5EmTTx4vddymeotQdCf0xScBkdlvbKGZ9l2+Ryw+efW7mzViaj my3EXFKPgcH/4ZFfgZhOPYZOXuhcyFE0+y5EQ8RaF4H3heKVi/kqegAmkEG6pQdg34uj fd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uwq8/M2aLzWgGOP5US81C1T+0UYaharO+hUGYasz/qo=; b=gq/jNz9fzcs9gKLybbsJyogZYw+UL17TYP4xQIsIPZqJ3hbBCbS+EjJW2aIdP3TZcO 3Yn3q/tI+y758ndjFrwQhFUMcgbUcGoKQe65+1MK79DyKON44K0CJqQvwuJe57zFRy1B HMxmKzkTmwVq3GvTlTaINYe9mKqdky7C01MLdeR41oIX42OQ1tlfT0LPmrs9M9F9Ki2B AzrTf17CmLRbDb7aBQZUZG1W4oaDXIXhuY9wwXilT21BT+o45vO3lpLq4I0sBznbW506 A17E3tQpVuiIWVnq831ZaXBfbAKQZkpVh5mlXawPIbIiJSjjBDgeyok4LZIorpKeiJP9 c4JA== X-Gm-Message-State: APt69E3FIYOi8wTOYBsuRMW/U9B900VJt+TPSCdxgDDtbwDxilvVhzvl M6WOC8EhHLVDIg4mTF55eE4iGI3DHgj2V4/EIX+dABu+ X-Received: by 2002:aa7:d84a:: with SMTP id f10-v6mr1500865eds.157.1528253406265; Tue, 05 Jun 2018 19:50:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:90d3:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 19:50:05 -0700 (PDT) In-Reply-To: <362131bf-3b6b-58aa-bda6-003f5ffb5e8e@redhat.com> References: <20180604123238.82200-1-chiu@endlessm.com> <20180605023124.GE47042@localhost.localdomain> <38cb3527-8480-bdb9-a5d9-b601bc494a5f@redhat.com> <71df09bc89619aba975147e6b07920f1dfc2f46f.camel@hadess.net> <94789b55b88ae5a296e1fca3b0311318e7b507ee.camel@hadess.net> <0443419b-3147-163b-374d-bb8651b08837@redhat.com> <362131bf-3b6b-58aa-bda6-003f5ffb5e8e@redhat.com> From: Chris Chiu Date: Wed, 6 Jun 2018 10:50:05 +0800 Message-ID: Subject: Re: [PATCH 1/2] platform/x86: asus-wmi: Call new led hw_changed API on kbd brightness change To: Hans de Goede Cc: Benjamin Berg , Bastien Nocera , Darren Hart , Daniel Drake , Corentin Chary , Andy Shevchenko , Linux Kernel , Platform Driver , acpi4asus-user , Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 5, 2018 at 7:06 PM, Hans de Goede wrote: > Hi, > > > On 05-06-18 12:46, Benjamin Berg wrote: >> >> Hey, >> >> On Tue, 2018-06-05 at 12:31 +0200, Hans de Goede wrote: >>> >>> On 05-06-18 12:14, Bastien Nocera wrote: >>>> >>>> On Tue, 2018-06-05 at 12:05 +0200, Hans de Goede wrote: >>>>> >>>>> On 05-06-18 11:58, Bastien Nocera wrote: >>>>>> >>>>>> [SNIP] >>>>> >>>>> >>>>> Ok, so what are you suggestion, do you really want to hardcode >>>>> the cycle behavior in the kernel as these 2 patches are doing, >>>>> without any option to intervene from userspace? >>>>> >>>>> As mentioned before in the thread there are several example >>>>> of the kernel deciding to handle key-presses itself, putting >>>>> policy in the kernel and they have all ended poorly (think >>>>> e.g. rfkill, acpi-video dealing with LC brightnesskey presses >>>>> itself). >>>>> >>>>> I guess one thing we could do here is code out both solutions, >>>>> have a module option which controls if we: >>>>> >>>>> 1) Handle this in the kernel as these patches do >>>>> 2) Or send a new KEY_KBDILLUMCYCLE event >>>>> >>>>> Combined with a Kconfig option to select which is the default >>>>> behavior. Then Endless can select 1 for now and then in >>>>> Fedora (which defaults to Wayland now) we could default to >>>>> 2. once all the code for handling 2 is in place. >>>>> >>>>> This is ugly (on the kernel side) but it might be the best >>>>> compromise we can do. >>>> >>>> >>>> I don't really mind which option is used, I'm listing the problems with >>>> the different options. If you don't care about Xorg, then definitely go >>>> for adding a new key. Otherwise, processing it in the kernel is the >>>> least ugly, especially given that the key goes through the same driver >>>> that controls the brightness anyway. There's no crazy cross driver >>>> interaction as there was in the other cases you listed. >>> >>> >>> Unfortunately not caring about Xorg is not really an option. >>> >>> Ok, new idea, how about we make g-s-d behavior upon detecting a >>> KEY_KBDILLUMTOGGLE event configurable, if we're on a Mac do a >>> toggle, otherwise do a cycle. >>> >>> Or we could do this through hwdb, then we could add a hwdb entry >>> for this laptop setting the udev property to do a cycle instead of >>> a toggle on receiving the keypress. >> >> >> If we are adding hwdb entries anyway to control the userspace >> interpretation of the TOGGLE key, then we could also add the new CYCLE >> key and explicitly re-map it to TOGGLE. That requires slightly more >> logic in hwdb, but it does mean that we could theoretically just drop >> the workaround if we ever stop caring about Xorg. > > > Hmm, interesting proposal, I say go for it :) > > Regards, > > Hans > > > So maybe the next stop is that I can follow Darren's suggestion to eliminate the is_kbd_led_event() and send a v2 for review?