Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935153AbcKMUpe (ORCPT ); Sun, 13 Nov 2016 15:45:34 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34627 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933451AbcKMUp3 (ORCPT ); Sun, 13 Nov 2016 15:45:29 -0500 Date: Sun, 13 Nov 2016 21:45:25 +0100 From: Pavel Machek To: Hans de Goede Cc: Jacek Anaszewski , Tony Lindgren , Jacek Anaszewski , linux-leds@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Darren Hart Subject: Re: Three different LED brightnesses (was Re: PM regression with LED changes in next-20161109) Message-ID: <20161113204525.GA15072@amd> References: <20161110175537.GF27724@atomide.com> <20161110202910.GE28832@amd> <80b645e7-c3fa-8001-d9b1-c3c8c40394fd@gmail.com> <20161111120114.GA1076@amd> <20161111221224.GB10983@amd> <3ca04742-6376-5a88-8d10-5b88fcd8f5e5@redhat.com> <20161113091054.GA17790@amd> <3a3bb3f8-e54a-e7d0-da30-7f90b00c29b3@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: <3a3bb3f8-e54a-e7d0-da30-7f90b00c29b3@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2597 Lines: 79 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >No, that's just adding more mess on the system. > > > >Here's better proposal: > > > >brightness (write): what we do today. (Mess, but too late to change it) > > (read): -Esomething or what we do today (if someone > > acutally uses it) >=20 > As said Jacek has already nacked any changes to read behavior. >=20 > > (poll): -Esomething >=20 > Making poll() on sysfs attributes return -Esomething is not possible, > the internal sysfs API does not allow this. >=20 > >current_brightness (write): -Esomething, or maybe change brightness > > for triggers that can work with that > > (read, poll): if the current trigger can get current > > state of led, do it, otherwise -Esomething... > > or maybe file should be simply hidden from sysfs. >=20 > So write is -EINVAL and read is the same as what brightness currently doe= s, > so I see no use in introducing this new file. No, read is not same as current brightness file. Currently, reading brightness file returns either current brightness or maximum brightness, and userspace can't tell which is which. > >trigger_max_brightness (read,write): change the maximum brightness for > > a trigger. > > (poll): -Esomething >=20 > The write behavior here is the same as what brightness currently does > and the read behavior is that of what I suggested for No, it is not. "brightness" behaviour is currently broken, as it sets either current brightness or maximum trigger brightness. > We've 2 sorts of brightness really: >=20 > 1) transient brightness, aka current brightness, when blinking or > triggers are used this will switch many times a second > between off and some on level. >=20 > 2) non-transient brightness, for non blinking leds this is the > actual brightness, for blinking leds this is the brightness > level used when the led is on. Yes, and we want reasonable interface where userspace sees those two brightnesses. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlgo0OUACgkQMOfwapXb+vKF8wCggW5FxPc9J+i9Dbc0N473Gfmp TgYAoJVAyrjIij7H81udzI3QRS9Cyguk =h1zT -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g--