Linux LED subsystem development
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Johan Adolfsson <Johan.Adolfsson@axis.com>,
	Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kernel <Kernel@axis.com>
Subject: Re: [PATCH RFC] leds: leds-lp50xx: Handle reg to get correct multi_index
Date: Wed, 14 May 2025 21:55:43 +0200	[thread overview]
Message-ID: <449cf572-f637-42c9-b804-aaf74178e96b@gmail.com> (raw)
In-Reply-To: <PAWPR02MB92815DC59F65E90956269EEC9B91A@PAWPR02MB9281.eurprd02.prod.outlook.com>

Hi Johan,

On 5/14/25 16:34, Johan Adolfsson wrote:
> From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Sent: Tuesday, May 13, 2025 21:52
> To: Johan Adolfsson; Lee Jones; Pavel Machek
> Cc: linux-leds@vger.kernel.org; linux-kernel@vger.kernel.org; Kernel
> Subject: Re: [PATCH RFC] leds: leds-lp50xx: Handle reg to get correct multi_index
> ..
>>>                        }
>>> +                     ret = fwnode_property_read_u32(led_node, "reg", &multi_index);
>>> +                     if (ret) {
>>> +                             multi_index = num_colors;
>>
>> Why not to fail if 'reg' parsing fails?
>> It is marked required in DT bindings [0].
> 
> I didn't want to start failing if reg is missing since it has never been handled until now, despite what the doc says since 2022...

There is one in-tree user [0], and we will need to patch it as well,
because it uses reg 0,1,2 for each RGB LED module, instead of iout
numbers as it will be after your change.

We will need to also state clearly in the bindings that 'reg' property
maps to iouts for the non-banked RGB LED modules.

For banked RGB LED modules it is more tricky, because there is one
LED multicolor class device created for them. Probably to be correct
we would need make the 'reg' properties in the subnodes also arrays
reflecting iouts that will be governed by BANK_A_Color, BANK_B_Color,
and BANK_C_Color registers respectively. And DT parser in the driver
would need to enforce proper iout definition for the banked modules

E.g. the multi-led@3 node from the example should look like below:

             multi-led@3 {
                 #address-cells = <1>;
                 #size-cells = <0>;
                 reg = <0x3>, <0x4>, <0x5>;
                 color = <LED_COLOR_ID_RGB>;
                 function = LED_FUNCTION_STANDBY;

                 led@9 {
                     reg = <0x9>, <0xc>, <0xf>;
                     color = <LED_COLOR_ID_RED>;
                 };

                 led@a {
                     reg = <0xa>, <0xd>, <0x10>;
                     color = <LED_COLOR_ID_GREEN>;
                 };

                 led@b {
                     reg = <0xb>, <0xe>, <0x11>;
                     color = <LED_COLOR_ID_BLUE>;
                 };


[0] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts

-- 
Best regards,
Jacek Anaszewski


  reply	other threads:[~2025-05-14 19:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 10:39 [PATCH RFC] leds: leds-lp50xx: Handle reg to get correct multi_index Johan Adolfsson
2025-05-08 14:57 ` Lee Jones
2025-05-10 15:32 ` Jacek Anaszewski
2025-05-12 10:59   ` Johan Adolfsson
2025-05-12 18:10     ` Jacek Anaszewski
2025-05-13 13:04       ` Johan Adolfsson
2025-05-13 19:50         ` Jacek Anaszewski
2025-05-14 14:41           ` Johan Adolfsson
2025-05-13 19:52 ` Jacek Anaszewski
2025-05-14 14:34   ` Johan Adolfsson
2025-05-14 19:55     ` Jacek Anaszewski [this message]
2025-05-15  7:36       ` Johan Adolfsson
2025-05-18 15:16         ` Jacek Anaszewski

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=449cf572-f637-42c9-b804-aaf74178e96b@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=Johan.Adolfsson@axis.com \
    --cc=Kernel@axis.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    /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