Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2093567imu; Sat, 5 Jan 2019 14:33:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/V7dyPFh8Cahw2qZ+oBkpJ6gDjgOJdDnxSQPJlxjLq+qGxgEDkeB/XVvxTCoKpMYkr0NQX/ X-Received: by 2002:a62:868b:: with SMTP id x133mr60565880pfd.252.1546727587048; Sat, 05 Jan 2019 14:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546727587; cv=none; d=google.com; s=arc-20160816; b=Tbbs4W7QpFH0JIF4K/4ADAHD/BZIPKnuC84BP8AcKBQYyN7uvnC0c4rZftIpw4pC/v Z3FAmKegidocMcEYD8sRhU5b3lliffqSlJbAlQQQPhv9dnUPuz/c0yfg+ZC5nTz1dcaz ttAqs0PSma8R2X5Oefb2NU0QhleNIlqonlmdL3I1p6ejr/naNnVqztj3etAOR4lxZUiD ZBJt5fRSWd6xKczIIdBBhGx+8eOEe3Pg+bfO2dQTf0q1ZHuqI/05oq3U6PVPtH4ftInY L+XxcEJLdpYYLZsiY+SL1d9Smk+i0jdXzm5PZsOPEYZw8aBbBAbft9vUdI5ch79ogaGq 2v4g== 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=9y0UFlXPR8Sou9EMOLvC6gDt/0AAyPt8iBpHBDZWnzM=; b=NzjPOjkUmBMupXz5JWhU+3HOICuAUit0yqQOvu5lDa+fzi1f8ElnhJ1iUX3oTjoGV3 X8OEl0j/BQIRTn13N6AbswvXs283/bTm/jy0RXYNqJlEat3ca0kTqoHDQHqjlBU/lxtm 7XX97bK9GNfmtAX1toZ4ke2Q+NJ72ouSFi4acv15kF51rtkwpwgfLh8WKa1CqD4CBlPm hIY8oIfWnh4EbL4X7hARnz8aTF60fhoQ0RIoIT8IzGO993PtDzXLU5a8/HQP6LQ/I+I6 uzRcATDqStir0xAL8BfHA6ahKIuPIneXSdLISFtumMJbA46ofWCTDdQA1HlpBJFFCfK7 rNoA== 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 y20si8290869pgi.50.2019.01.05.14.32.51; Sat, 05 Jan 2019 14:33:07 -0800 (PST) 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 S1726406AbfAEWbF (ORCPT + 99 others); Sat, 5 Jan 2019 17:31:05 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:38446 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726388AbfAEWbF (ORCPT ); Sat, 5 Jan 2019 17:31:05 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id DA4C2809AA; Sat, 5 Jan 2019 23:12:49 +0100 (CET) Date: Sat, 5 Jan 2019 23:12:54 +0100 From: Pavel Machek To: Jacek Anaszewski Cc: Vesa =?iso-8859-1?B?SuTkc2tlbORpbmVu?= , Dan Murphy , robh+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Generic RGB LED support was Re: [PATCH 2/2] leds: lp5024: Add the LP5024/18 RGB LED driver Message-ID: <20190105221254.GA22322@amd> References: <986b5105-2fdb-bd25-7c8a-ca8fd1ade821@gmail.com> <7f205102-e854-f1cb-cc03-1307d1cddc87@gmail.com> <20190104201256.GA2931@amd> <20190104220726.GA12395@amd> <4cf79414-578e-eea7-4f46-fc8789206988@gmail.com> <20190105123146.GA16354@amd> <8044cdd9-b9b3-fddd-6106-184b906859e2@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <8044cdd9-b9b3-fddd-6106-184b906859e2@gmail.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 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >Grab yourself an RGB LED and play with it; you'll see what the > >problems are. It is hard to explain colors over email... >=20 > Video [0] gives some overview of lp5024 capabilities. >=20 > I don't see any problems in exposing separate red,green,blue > files and brightness for the devices with hardware support for > that. Well, that's what we do today, as three separate LEDs, right? I don't have problem with that, either; other drivers already do that. He's free to use existing same interface. But that is insufficient, as it does not allow simple stuff, such as turning led "white". So... perhaps we should agree on requirements, first, and then we can discuss solutions? Requirements for RGB LED interface: 1) Userspace should be able to set the white color 2) Userspace should be able to arbitrary color from well known list and it should approximately match what would CRT, LCD or OLED monitor displ= ay 2a) LEDs probably slightly change color as they age. That's out of scope, unless the variation is much greater than on monitors. 2b) Manufacturing differences cause small color variation. Again, that's out of scope, unless the variation is much greater than on monitors. Nice to have features: 3) Full range of available colors/intensities should be available to userspace 4) Interface should work well with existing triggers 5) It would be nice if userland knew how many lumens are produced at each wavelength for each setting (again, minus aging and manufacturing variations). 6) Complexity of math in kernel should be low, and preferably it should be integer or fixed point Problems: a) RGB LEDs are usually not balanced. Setting 100% PWM on red/green/blue channels will result in nothing close to white light. In fact, to get white light on N900, blue and green channel's PWM needs to be set pretty low, as in 5%. b) LED class does not define any relation between "brightness" in sysfs and ammount of light in lumens. Some drivers use close to linear relation, some use exponential relation. Human eyes percieve logarithm of lumens. RGB color model uses even more complex function. c) Except for white LEDs, LEDs are basically sources of single wavelength of light, while CRTs and LCDs produce broader spectrums. d) RG, RGBW and probably other LED combinations exist. e) Not all "red" LEDs will produce same wavelength. Similar differences will exist for other colors. f) We have existing RGB LEDs represented as three separate monochromatic LEDs in sysfs. --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwxK+YACgkQMOfwapXb+vILFgCgxOnOlQp18Z6SjAygRd9g2tSi +T4An2pAO1RIQFE+zBc98noNikm5JT4S =CbTN -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv--