Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1369707yba; Thu, 9 May 2019 15:36:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk+/MenaAva5DLAb91Y1jeIpOEm+DnDuMCp2whgcn5Z83BdPVQNspv8eEEzlzVOkQ4DXjF X-Received: by 2002:aa7:8190:: with SMTP id g16mr9016983pfi.92.1557441383279; Thu, 09 May 2019 15:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557441383; cv=none; d=google.com; s=arc-20160816; b=uPNLBrQGZXCUIw+vfZ7OwMOxTWgYZHZ891k8JgkKEAIHUcSRY548qjom5hPFTPAiTl opUO3Fa4UgcqjEqrsNCVh2iLJLuV0wd1agpSn/KeGri4QCh6H8bd9f4sAoZiP3od4Ayn kWfxByABfhc9G0SFyrZc5XKGh+Blw+EpgE/VOONYtWnE5Y2R0iTeYrYdC/7V+DI6YwnN FbNWdme1cvyptttyaZkPkjRMXSP1UNJSEU93O5ZKE/WHQx2gyKiY/YvGqWVJCqC/k1nK b8zuoXk84HSM+DRe8710181F/gQFp4EPrQYjo+p6at2aR6/SGF6eAosVt744eNmDD5zL S2RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0psfvAuLeLX6LeMBEPRIlWTDGZ+H4iOxDHRqoqtilJ8=; b=X61NlqIBkGHTGEsInf6S0mzteSqXlZnMIv8Z+JBtKlaL5ozqvWZKWRM/oCBcCcEVNg EvoGMnpRe9IZqfEg6e4JbcPyo2Xjp9vMG5lVCXMQoeKj93jvW11+QlS4zJDwe/9tx+ed ifMEMQfvyw2U8T+sUQv/4lD+vhXsXKFfEEgslPuihFm44Z1vmg+SLj17VdjTnzPSojNQ qpDmg93YGX5gH/LyUQXsjIae8r2N0caN2mvlZxeB/yG9wICheos+P6uXHnTu3dHgaJVN vmILliXb9Cgq4wdku1CRGuQKKledOqBcuStPWeQdAqTuWhoQpmG1jXuFl0Z7PfaL4p8M Kp5Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si5532375pgc.136.2019.05.09.15.35.54; Thu, 09 May 2019 15:36:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbfEIWeh (ORCPT + 99 others); Thu, 9 May 2019 18:34:37 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41484 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfEIWeh (ORCPT ); Thu, 9 May 2019 18:34:37 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 3BD88802A4; Fri, 10 May 2019 00:34:24 +0200 (CEST) Date: Fri, 10 May 2019 00:34:37 +0200 From: Pavel Machek To: Dan Murphy Cc: Yurii Pavlovskyi , Andy Shevchenko , Jacek Anaszewski , Linux LED Subsystem , Corentin Chary , Darren Hart , Andy Shevchenko , Daniel Drake , acpi4asus-user , Platform Driver , Linux Kernel Mailing List , linux-api@vger.kernel.org Subject: Re: [PATCH v3 09/11] platform/x86: asus-wmi: Control RGB keyboard backlight Message-ID: <20190509223436.GB527@amd> References: <7acd57fe-604a-a96a-4ca2-a25bc88d6405@gmail.com> <20190508171229.GA22024@amd> <52e73640-9fbf-437b-537a-7b3dc167052f@gmail.com> <2f26dd9e-ada7-8e20-c810-a647854c338c@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CUfgB8w4ZwR/yMy5" Content-Disposition: inline In-Reply-To: <2f26dd9e-ada7-8e20-c810-a647854c338c@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >> Yes, please. We have common interface for LED drivers; this needs to > >> use it. > >=20 > > That is indeed a better option and I did in fact considered this first = and > > even did a test implementation. The discoveries were: > > 1. The WMI methods are write-only and only written all at once in a > > transaction manner (also invoking solely first RGB-interface method has= no > > effect until some other keyboard backlight method is called). Write-only is not a problem, right? Nor should be transaction. Just cache the values in kernel. > > 2. In addition to RGB there are several control values, which switch > > effects, speed and enable or disable the backlight under specific > > conditions or switch whether it is set temporarily or permanently (not = that > > these are critical functionalities, but for the sake of > > completeness). Yep, lets ignore that for now. > > 3. The EC is really slow > > # time bash -c "echo 1 > /sys/devices/platform/faustus/kbbl_set" > >=20 > > real 0m0,691s > > user 0m0,000s > > sys 0m0,691s > >=20 > > (please ignore the sysfs-path there, it's essentially the same code run= ning > > as in this patch). It is consistently same for both temporary and perma= nent > > configuration. Writing after every change would take about (6+)x of tha= t. > > Not that it's that unbearable though as it is not likely to be > > done often. Yup, this is quite ugly. What about simply ignoring changes as they happen, and then setting RGB channels when nothing changes for 10msec? > > I was not quite happy with that implementation so I opted for writing s= ort > > of sysfs wrapper instead that would allow same sort of transactions as > > provided by BIOS. I agree that it's non-standard solution. > >=20 > > If I understood correctly, the typical current RGB led_class devices fr= om > > the Linux tree currently provide channels as separate LEDs. There are a= lso > > blink / pattern options present, I guess one could misuse them for sett= ing > > effects and speed. So one could make 3 devices for RGB + 3 for awake, > > sleep, boot modes + 1 for setting effect / speed. Take a look at "pattern" trigger. That should give you effect/speed options. .. for single channel. > > I'd guess the end solution might be also either something like combinat= ion > > of both approaches (RGB leds + separate sysfs interface) or some extens= ion > > of the led_class device interface. Dropping support of the non-essential > > features for the sake of uniformity of ABI would also be an option to > > consider (exposing just three RGB LEDs with brightness only), not happy= one > > though. > >=20 > > In any case this looks like it might need some additional research, > > discussion, development, and a pair of iterations so I tend to separate > > this patch from the series and post it extra after the others are throu= gh > > to avoid dragging 10+ patches around. Separate patch certainly makes sense. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzUqvwACgkQMOfwapXb+vK90gCfa5VCwbhBeQ0RlMOZuDkqJBma raAAnj+RO123XbofMN8InUVu/ER8DTMR =EKgO -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5--