[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PAWPR02MB92814A311B18A6FD8A448D249B97A@PAWPR02MB9281.eurprd02.prod.outlook.com>
Date: Mon, 12 May 2025 10:59:17 +0000
From: Johan Adolfsson <Johan.Adolfsson@...s.com>
To: Jacek Anaszewski <jacek.anaszewski@...il.com>, Lee Jones <lee@...nel.org>,
Pavel Machek <pavel@...nel.org>
CC: "linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Kernel
<Kernel@...s.com>, Johan Adolfsson <Johan.Adolfsson@...s.com>
Subject: Re: [PATCH RFC] leds: leds-lp50xx: Handle reg to get correct
multi_index
From: Jacek Anaszewski <jacek.anaszewski@...il.com>
Sent: Saturday, May 10, 2025 17:32
To: Johan Adolfsson; Lee Jones; Pavel Machek
Cc: linux-leds@...r.kernel.org; linux-kernel@...r.kernel.org; Kernel
Subject: Re: [PATCH RFC] leds: leds-lp50xx: Handle reg to get correct multi_index
>Hi Johan,
>
>On 5/6/25 12:39, Johan Adolfsson wrote:
>> mc_subled used for multi_index needs well defined array indexes,
>> to guarantee the desired result, optionally use reg for that.
>>
>> If devicetree child nodes is processed in random or reverse order
>> you may end up with multi_index "blue green red" instead of the expected
>> "red green blue".
>> If user space apps uses multi_index to deduce how to control the leds
>> they would most likely be broken without this patch if devicetree
>> processing is reversed (which it appears to be).
>
>Are you trying to solve some real problem that occurred to you?
Yes! Since the subled is indexed by the processing order, it gets reversed if devicetree processing is reversed
(which I understand is a "feature"), so instead of "red green blue" I would get "blue green red" in the multi_index file without this patch.
The mapping to the hardware does not match that, so writing "255 0 0" to multi_intensity will give me red and not blue.
>The order of DT nodes parsing is not a problem here - we save
>color index in subled_info to be able to figure out which color
>is on which position. This information can be retrieved in sysfs
>by reading multi_index file.
Maybe the bug is somewhere else in the leds-lp50xx if that is supposed to work,
but I still think it's a good thing to be able to get the expected order in the multi_index file.
>
>--
>Best regards,
>Jacek Anaszewski
Best regards
/Johan
Powered by blists - more mailing lists