devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: sven@svenschwermer.de, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, linux-pwm@vger.kernel.org
Cc: Sven Schwermer <sven.schwermer@disruptive-technologies.com>,
	pavel@ucw.cz, dmurphy@ti.com, robh+dt@kernel.org,
	thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de,
	lee.jones@linaro.org
Subject: Re: [RFC PATCH 0/2] Multicolor PWM LED support
Date: Tue, 25 Jan 2022 23:31:09 +0100	[thread overview]
Message-ID: <a147897a-2823-ad45-d727-0b96f48b4da3@gmail.com> (raw)
In-Reply-To: <20220125092239.2006333-1-sven@svenschwermer.de>

Hi Sven,

On 1/25/22 10:22 AM, sven@svenschwermer.de wrote:
> From: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
> 
> Hi,
> 
> As previously discussed [1] on the linux-leds list I am missing
> multicolor PWM LED support. In the mean time I have put together a
> working prototype for such a driver. This is my first Linux driver
> so I'm hoping for some feedback. Here are some questions that came up
> while putting this thing together:
> 
>    1. Currently, the max-brightness property is expected as a property to
>       the multi-led node. That seems consistent with the existing
>       multicolor class code, but I'm wondering whether it would make
>       sense to have a max-brigthness for the individual LEDs as well?

For the proper mixed color calculation all sub-leds should have
the same max_brightness as the global max_brightness.

Look at how sub-led intensities are calculated in
led_mc_calc_color_components().

See also [0] and [1].

>    2. The current multi-led node definition calls for a node index which
>       would in turn require the reg property to be set within the node.
>       In this context, that doesn't seem to make sense. Should this
>       requirement be lifted from leds-class-multicolor.yaml?

reg is required for all DT nodes with address unit in the name.
If you skipped the address unit, then reg would be also not required.

>    3. I'm not currently reusing any leds-pwm code because there aren't
>       too many overlaps. Does anyone have suggestions what could be
>       factored out into a common source file?

I think that having a separate pwm driver for multicolor LEDs is a good
idea. leds-pwm.c is old and well tested driver, there's no need to
tinker at it for no vital reason. And there is not much code to share
as you've noticed.

> I would appreciate if anyone would test this code. It runs on my
> i.MX6ULL-based hardware.
> 
> Best regards,
> Sven
> 
> [1]: https://www.spinics.net/lists/linux-leds/msg19988.html
> 
> Sven Schwermer (2):
>    dt-bindings: leds: Add multicolor PWM LED bindings
>    leds: Add PWM multicolor driver
> 
>   .../bindings/leds/leds-pwm-multicolor.yaml    |  73 +++++++
>   drivers/leds/Kconfig                          |   8 +
>   drivers/leds/Makefile                         |   1 +
>   drivers/leds/leds-pwm-multicolor.c            | 184 ++++++++++++++++++
>   4 files changed, 266 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
>   create mode 100644 drivers/leds/leds-pwm-multicolor.c
> 

[0] Documentation/ABI/testing/sysfs-class-led-multicolor
[1] Documentation/leds/leds-class-multicolor.rst

-- 
Best regards,
Jacek Anaszewski

  parent reply	other threads:[~2022-01-25 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  9:22 [RFC PATCH 0/2] Multicolor PWM LED support sven
2022-01-25  9:22 ` [RFC PATCH 1/2] dt-bindings: leds: Add multicolor PWM LED bindings sven
2022-01-25 14:25   ` Rob Herring
2022-01-25  9:22 ` [RFC PATCH 2/2] leds: Add PWM multicolor driver sven
2022-01-25 23:01   ` Jacek Anaszewski
2022-01-25 22:31 ` Jacek Anaszewski [this message]
2022-01-26  7:51   ` [RFC PATCH 0/2] Multicolor PWM LED support Sven Schwermer
2022-01-26 21:26     ` Jacek Anaszewski
2022-01-26  8:08 ` Alexander Dahl

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=a147897a-2823-ad45-d727-0b96f48b4da3@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=sven.schwermer@disruptive-technologies.com \
    --cc=sven@svenschwermer.de \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).