From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>, Richard Purdie <rpurdie@rpsys.net>,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Fenglin Wu <fenglinw@codeaurora.org>
Subject: Re: [PATCH v2 1/3] leds: core: Introduce generic pattern interface
Date: Mon, 17 Jul 2017 16:39:36 -0700	[thread overview]
Message-ID: <20170717233936.GB20973@minitux> (raw)
In-Reply-To: <61a2d8d2-7bf0-c8ff-90a2-728d8368da0a@gmail.com>
On Mon 17 Jul 14:08 PDT 2017, Jacek Anaszewski wrote:
> On 07/16/2017 11:14 PM, Bjorn Andersson wrote:
> > On Sun 16 Jul 11:49 PDT 2017, Jacek Anaszewski wrote:
> >> On 07/06/2017 05:18 AM, Pavel Machek wrote:
[..]
> >> I've been working on addition of RGB LED support to the LED core for
> >> some time now, in the way as we agreed upon at [0], but it turns out to
> >> be less trivial if we want to do it in an elegant way.
> >>
> > 
> > Generally 3 predefined LPG blocks are routed to the TRILED current sink.
> > 
> > Exposing the TRILED block as a RGB LED instance would make sense in its
> > own, but it doesn't give us a coherent solution for the LPG.
> > 
> > The current board I'm working on (DragonBoard820c) has 4 LEDs, 3 of them
> > are connected to the TRILED and the fourth is on a "GPIO" in current
> > sink mode.
> > 
> > By having each LPG represented as a LED device gives us a unified view
> > of the hardware even though there are two different types of current
> > sinks.
> > 
> > 
> > Further more, per the 96boards specification we're expected to have
> > different triggers on the different "colors" of the TRILED.
> 
> What is the function of TRILED block then? My first impression was
> that it allows for setting brightness on all three LED synchronously?
> 
It's nothing more than one hardware block providing 3 current sinks.
> > 
> > So I do not agree with imposing this kind of decisions on the board
> > design just to support this higher level feature.
> > 
> >> Less elegant way would be duplicating led-core functions and changing
> >> single enum led_brightness argument with the three ones (or a struct
> >> containing three brightness components)
> >>
> >> I chose to go the elegant way and tried to introduce led_classdev_base
> >> type that would be customizable with the set of ops, that would allow
> >> for making the number of brightness components to be set at once
> >> customizable. This of course entails significant amount of changes in
> >> the LED core and some changes in LED Trigger core.
> >>
> > 
> > I think that the RGB interface has to be a "frontend" of any
> > configurable LED instances and not tied to a particular hardware
> > controller.
> 
> That doesn't assure brightness setting synchronization which is
> especially vital in case of triggers like timer.
> 
If you look at any available Android based device you can see what
happens when you set red, then green and then blue brightness
independently - from user space even. The LED might be
red/green/blue/purple whatever, but I would argue that it's not
noticeable due to the short duration between the updates.
The case where synchronization matters is if you have pattern
transitions as you're extending the time of the transition and you can
spot the color variation in the transitions.
Regards,
Bjorn
next prev parent reply	other threads:[~2017-07-17 23:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 22:45 [PATCH v2 0/3] Qualcomm Light Pulse Generator Bjorn Andersson
2017-07-14 22:45 ` [PATCH v2 1/3] leds: core: Introduce generic pattern interface Bjorn Andersson
2017-07-06  3:18   ` Pavel Machek
2017-07-16 18:49     ` Jacek Anaszewski
     [not found]       ` <beb9b4c3-4922-1ebb-5017-a4b791cdb4d7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-16 21:14         ` Bjorn Andersson
2017-07-17 21:08           ` Jacek Anaszewski
2017-07-17 23:39             ` Bjorn Andersson [this message]
2017-07-18 21:36               ` Jacek Anaszewski
2017-08-12 19:22           ` Pavel Machek
     [not found]     ` <20170706031801.GB12954-5NIqAleC692hcjWhqY66xCZi+YwRKgec@public.gmane.org>
2017-07-16 19:57       ` Bjorn Andersson
2017-07-14 22:45 ` [PATCH v2 2/3] leds: Add driver for Qualcomm LPG Bjorn Andersson
     [not found] ` <20170714224520.467-1-bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-07-14 22:45   ` [PATCH v2 3/3] DT: leds: Add Qualcomm Light Pulse Generator binding Bjorn Andersson
2017-07-15  9:14     ` Pavel Machek
2017-07-16  5:35       ` Bjorn Andersson
2017-07-16 18:49     ` Jacek Anaszewski
2017-07-17  4:44       ` Bjorn Andersson
2017-07-17 21:08         ` Jacek Anaszewski
     [not found]           ` <8c5d2d85-24ac-2ff9-8512-f669063edf4c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-18  0:03             ` Bjorn Andersson
2017-07-18 21:38               ` Jacek Anaszewski
2017-07-15  9:10   ` [PATCH v2 0/3] Qualcomm Light Pulse Generator Pavel Machek
2017-07-16  5:34     ` Bjorn Andersson
2017-07-06  3:18       ` Pavel Machek
     [not found]         ` <20170706031813.GC12954-5NIqAleC692hcjWhqY66xCZi+YwRKgec@public.gmane.org>
2017-07-16 20:53           ` Bjorn Andersson
2017-07-16 21:15             ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20170717233936.GB20973@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fenglinw@codeaurora.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).