Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4611876imu; Sat, 19 Jan 2019 13:48:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN69vu4TNiI1SmxyS6qZ4Uil0W/gMmeuwlDklIR5WTwkJn+d8J2mHVBdpCmPWJivonehC6+o X-Received: by 2002:a63:cb4a:: with SMTP id m10mr21985289pgi.105.1547934504986; Sat, 19 Jan 2019 13:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547934504; cv=none; d=google.com; s=arc-20160816; b=b16Gip03rHS6Gt8xbovfn0duaAhNolriJBiy5mkavdBp8qPqhYKl3joHUAk/EuuTl5 lOmbc1VC8CUw26oKesGnMTrnIUsopIR+bHWSrTUT6A4wXXHgCEUxCssnDG7dReA5h2Cu irLvjlSSZhksZN1g3t0IiAecjDYUcHIornkxUA6kjWUnn1eK4HPBrGBfXM502z683JqF v4AVsa8QaWoHv+4JGCs0ED38JMmomYiseC+wPR45fMAhw54u+en+oLJjJsVsvgYgRzmw Bet3SC6Q+FYISSaFFwT+4+z6BgrNe39JIYQ8e8eF5+LHkMlIUxh5uTN2C7jx6V9ptJzD lYmQ== 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=A2jecGsgWej1dAzaWXfpwYjVUrd97tvzpkBWw/xapXc=; b=fRQ7FDFUQmh2WAWRJNg9UhzsMY+WDyyDD2twf0QvMmZ8A87vyB5GUwigln2Id9E0ih BpYcxaGHiycXvOJaCSyg89hhzCYwkuR9g7kTbilhwi/9ualWds4H0JFbHWbX/oD48UAA mvCLp5xWN8YX3T4sRXnwPnNVmnyeQYa8C4wwsEncu6jmiWxmCC/Ea5OZGeM8HbtB/FyU 5gRJOv2zmR6qxNKKNX3vFSf1jw4R0v26fKs5+GEmPQS5xqITu5PGf9JwoIpuhLCAmhHA UAebBUBLHThME622uWoS6Ob+/SRVdKIRcLkMBE36smDgS9gNcihK9C7ZghlyHOrujwCS Mi4w== 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 d12si8119280pla.351.2019.01.19.13.48.09; Sat, 19 Jan 2019 13:48:24 -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 S1729622AbfASVqL (ORCPT + 99 others); Sat, 19 Jan 2019 16:46:11 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:36653 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729056AbfASVqK (ORCPT ); Sat, 19 Jan 2019 16:46:10 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 56A8880543; Sat, 19 Jan 2019 22:46:01 +0100 (CET) Date: Sat, 19 Jan 2019 22:46:06 +0100 From: Pavel Machek To: Vesa =?iso-8859-1?B?SuTkc2tlbORpbmVu?= Cc: Jacek Anaszewski , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org Subject: Re: [PATCH v2 2/2] leds: lp50xx: Add the LP50XX family of the RGB LED driver Message-ID: <20190119214606.GA4712@amd> References: <20190114211723.11186-1-dmurphy@ti.com> <20190114211723.11186-2-dmurphy@ti.com> <20190115222223.GA17363@amd> <79394d17-3124-75b2-ccac-dc1046499d14@ti.com> <20190116105537.GA1803@amd> <4115ad75-22f7-d9ae-c38f-e0ab61fb6655@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <4115ad75-22f7-d9ae-c38f-e0ab61fb6655@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 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >Moreover, I think that RGB LED class with configurable > >brightness-model, and with possible color range adjustments via > >icc-profiles or something similar, is the best solution that has been > >proposed so far. It is just flexible. > > > >I'd like to capitalize on the ideas shared in this thread and have > >finally LED RGB class materialized. > > >=20 > I have now updated my github code with my understanding of the discussion: > https://github.com/vesajaaskelainen/linux/tree/wip-multi-color-led >=20 > Commits: > - dt-bindings: leds: Introduce linux,default-brightness-model for all leds > https://github.com/vesajaaskelainen/linux/commit/4ffb21d644056686096226bb= ede7c8c78b0254c2 > - drivers: leds: Add core support for multi color element LEDs > https://github.com/vesajaaskelainen/linux/commit/627f38bb78cebc694b8e6d73= 5fb088c87925435d > - dt-bindings: leds: leds-pwm: Introduce multi color element leds support > https://github.com/vesajaaskelainen/linux/commit/ef6c5730d621e79ea0b02470= caa83bc39439536a > - WIP: drivers: leds: leds-pwm: Add multi color element LED support. > https://github.com/vesajaaskelainen/linux/commit/0430a27823d9162926424b32= c23be1c53eb9cbe2 >=20 > First two commits are common and could be taken before I am happy with the > pwm led driver changes. This new conditional feature flag makes it a bit > harder. Of course one option would be to require it to be enabled. >=20 > Current set of concepts: > - brightness-model: hardware, onoff, linear > - could be extended in future with other modes like hsv if wanted Would it be enough to tell userspace what is relation between values it writes and output power? Onoff is subset of linear, I guess. We already have max_brightness in the API. > # Setting up color to not so bright purple with brightness set to 255 > $ echo "32 0 32 255" > color > # Setting up color to a bit brighter purple with brightness > $ echo "128 0 128 255" > color This would require colorspace conversion in kernel. I have: scales =3D (1., 0.39, 0.11) # for n900 val =3D map(lambda x: int((x**2.2)*255), val) (r, g, b) =3D val (r_, g_, b_) =3D m.scales red =3D r*r_ ... x**2.2 is simplified, real expression is more complex. But it is floating point math... Do we want to do that? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlxDmp4ACgkQMOfwapXb+vLiHACcCLj0rtLbmOrnP63lMapTQ3Hm xqkAn1NM814Qq9FoyTvD6QjbL0d/AvZm =mY3B -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW--