linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Dan Murphy <dmurphy@ti.com>, pavel@ucw.cz
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 6/9] leds: multicolor: Introduce a multicolor class definition
Date: Thu, 19 Sep 2019 23:32:07 +0200	[thread overview]
Message-ID: <045e1988-176c-b5ea-73cb-182b6210a3db@gmail.com> (raw)
In-Reply-To: <e1de10a6-49ad-c7f2-9246-5bee29f58c80@ti.com>

Dan,

On 9/19/19 3:07 AM, Dan Murphy wrote:
> Jacek
> 
> On 9/18/19 4:27 PM, Jacek Anaszewski wrote:
>> Hi Dan,
>>
>> I think Greg's guidance clarified everything nicely -
>> we will avoid <color> sub-dirs in favour of prefixes
>> to *intensity and *max_intensity.
> Yes I will make the change accordingly.  It will simplify the code.
>>
>> Before you will send an update I have some improvement
>> ideas regarding the remnants after the previous approach,
>> where single color intensity update resulted in updating
>> hardware state. Now the update will happen only on write to
>> brightness file, so we will not need color_set/color_get ops
>> anymore.
> 
> I left those call backs in specifically for the LP50xx. Otherwise the
> LEDs are only updated when the brightness file is written.

> The LP50xx has an engine that performs the intensity computation for the
> specific LED.  So there is no call back to the MC FW for calculating the
> intensity.
> 
> The brightness and intensity are written directly to the device and the
> MCU in the device does all the computations so you have real time update.

You can still handle that in brightness_set op. You need to compare
which color channels have changed and update them in hardware in
addition to setting LEDn_BRIGHTNESS register.

And yes - even updating a single color will need two operations:

echo 231 >  colors/red_intensity // only cache the color in MC core
echo 100 > brightness // do the actual hw update

Note that brightness value doesn't have to be necessarily different
from the previous one here, but writing brightness file will be needed
to trigger the hw update.

> For the LP55xx device the LEDs are only updated when the brightness file
> is written.
> 
> I think we can leave those call backs in if device driver or product
> development teams would like to use them.

I'd not do that - it will be confusing. We can accomplish everything
in brightness_set{_blocking} op. It will have also the advantage of
same ABI semantics across all devices. Otherwise we would need separate
documentation for devices like LP50xx.

I have also another question - what with linear vs logarithmic
LP50xx brightness scale? I think we should make both options available
to the userspace.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-09-19 21:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 17:59 [PATCH v6 1/9] leds: multicolor: Add sysfs interface definition Dan Murphy
2019-09-17 17:59 ` [PATCH v6 2/9] documention: leds: Add multicolor class documentation Dan Murphy
2019-09-17 17:59 ` [PATCH v6 3/9] dt: bindings: Add multicolor class dt bindings documention Dan Murphy
2019-09-17 17:59 ` [PATCH v6 4/9] dt-bindings: leds: Add multicolor ID to the color ID list Dan Murphy
2019-09-17 17:59 ` [PATCH v6 5/9] " Dan Murphy
2019-09-17 17:59 ` [PATCH v6 6/9] leds: multicolor: Introduce a multicolor class definition Dan Murphy
2019-09-18 17:09   ` Dan Murphy
2019-09-18 19:56     ` Greg KH
2019-09-18 21:27   ` Jacek Anaszewski
2019-09-19  1:07     ` Dan Murphy
2019-09-19 21:32       ` Jacek Anaszewski [this message]
2019-09-20 12:31         ` Dan Murphy
2019-09-17 17:59 ` [PATCH v6 7/9] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers Dan Murphy
2019-09-17 17:59 ` [PATCH v6 8/9] leds: lp50xx: Add the LP50XX family of the RGB LED driver Dan Murphy
2019-09-17 17:59 ` [PATCH v6 9/9] leds: Update the lp55xx to use the multi color framework Dan Murphy

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=045e1988-176c-b5ea-73cb-182b6210a3db@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).