Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp759140imm; Tue, 5 Jun 2018 04:07:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI/w0nTe8Z6xTbf+8kHM5pVDeTy5/I6LUNL0RGfe/CD40ArCsLHBr7FuCb9a/Fb953xOCJ9 X-Received: by 2002:a17:902:369:: with SMTP id 96-v6mr26118925pld.64.1528196865630; Tue, 05 Jun 2018 04:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528196865; cv=none; d=google.com; s=arc-20160816; b=N6SvRDDcYiicglza+GMTwksOn3RrKYh5mdW9KZ9M00zbvrfNN8a5EjUEvQ9lgDwYgX YeecJ4aQlJ81uuHVV1oqiInKqJk6857IwYRlPTPUmgrYakLkmSjKnbE1rx4E88EDdcq0 9r+wAA0RYTOw2sSHzxr9qdXNifvQHijVxNlMQN3/ne4dOlWbxQPCIBNlhEhIVSPJZaxx 30ilVTBAyy8HM+BkxWz69BIBVAEIZoHnEV9gJq3nVFZ6MqYf/CL9bV05h0Td6/e4Z03C 5rpH+jaiInYnSpiu8JFjaK2bliwHKshoNhv7QzTkLCSJzBuO8wvIow4UnnPyGTpIBAw9 s/Mw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=f4QU0riudxrInFor2S3Nbub8s7nK7V4N65MDPbYRlOw=; b=aKWg0uSIaSneowAurk0O0BCXEEY9CMDznMatJDGAbBlSYvOAtroRO5NPdUs8fOYzrs gtEKyldvXzSM/uynycp4bk8ACB9yA3fRzgJi2DX6R296Ncy/qneeshNS/DtRQVS0/oOx zWWSqNxFwVte9mlEubDeH8DBm8V5+9nEgdRcF5F3+LGZWL3dxEu9WQ2DmGHZZgpyLmW4 CrxM6uSi/xnKUkZ6Yb/0XAAb17fH+AT/mrujgeE4LRc+BUbNE3OH+kGVfe37AtH8D9i4 gZB0hKDFSlZjSxCSXexujCPeWJTNf3ETtrCPWQzK6ngUl7gs8grkBuClTUFwXI/RIol/ kuMw== 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 d5-v6si15183735plr.13.2018.06.05.04.07.30; Tue, 05 Jun 2018 04:07:45 -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 S1751844AbeFELGG (ORCPT + 99 others); Tue, 5 Jun 2018 07:06:06 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52863 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbeFELGF (ORCPT ); Tue, 5 Jun 2018 07:06:05 -0400 Received: by mail-wm0-f68.google.com with SMTP id p126-v6so4115190wmb.2 for ; Tue, 05 Jun 2018 04:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f4QU0riudxrInFor2S3Nbub8s7nK7V4N65MDPbYRlOw=; b=SC1Z8STKux72HLK/HmDPcvvAHIuB3QKdkk72S+KxvFWOqrAYRdaUU4Sr++cO4S6siy K5IHIUP/dbpF6rXhC8/NFGqtcpOPWvIfrX7f6L32/ks6rRyE6ggERgJMg3PZfXQIpbhD Tx73c2uaTTwJtkqB1VTHZe1OYc691YmO6aJYeDEitXT811sWdrNsMiyGbrPsDJ0Kt9A0 CeNpWIyBi4cVogQx/1/cUHEQxsqLM2oM2q2JAQeSz7RtjwfDZQG8g6uiel2cFBflQf8w oxcxC8W0uCwJRxMleF8kHXUA/+0OjVnqX3S3O5oIFqCPUhqI7DuC7gcMHPf60tQnoASR 4+cw== X-Gm-Message-State: ALKqPwddkre4uIP2JnjPpOoSvLPP0qs2XE9y3iWC7GF4vpLVC8botJvs LBRHqtr/QrmaOXk853WtKgcw8A== X-Received: by 2002:aa7:d819:: with SMTP id v25-v6mr29433931edq.61.1528196763705; Tue, 05 Jun 2018 04:06:03 -0700 (PDT) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id n30-v6sm15815247edd.36.2018.06.05.04.06.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 04:06:02 -0700 (PDT) Subject: Re: [PATCH 1/2] platform/x86: asus-wmi: Call new led hw_changed API on kbd brightness change To: Benjamin Berg , Bastien Nocera , Chris Chiu , Darren Hart Cc: Daniel Drake , Corentin Chary , Andy Shevchenko , Linux Kernel , Platform Driver , acpi4asus-user , Linux Upstreaming Team 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> From: Hans de Goede Message-ID: <362131bf-3b6b-58aa-bda6-003f5ffb5e8e@redhat.com> Date: Tue, 5 Jun 2018 13:06:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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