From: Conor Dooley <conor@kernel.org>
To: Johan Adolfsson <Johan.Adolfsson@axis.com>
Cc: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Andrew Davis <afd@ti.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Kernel <Kernel@axis.com>
Subject: Re: [PATCH v6 2/2] dt-bindings: leds: lp50xx: Document child reg, fix example
Date: Mon, 16 Jun 2025 16:56:06 +0100 [thread overview]
Message-ID: <20250616-thigh-ferocity-c8e1d7ee18bb@spud> (raw)
In-Reply-To: <PAWPR02MB9281AC0A179DC8526EA074599B70A@PAWPR02MB9281.eurprd02.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 4225 bytes --]
On Mon, Jun 16, 2025 at 03:45:29PM +0000, Johan Adolfsson wrote:
>
> ________________________________
> From: Conor Dooley
> Sent: Monday, June 16, 2025 17:03
> To: Johan Adolfsson
> Cc: Lee Jones; Pavel Machek; Rob Herring; Krzysztof Kozlowski; Conor Dooley; Andrew Davis; Jacek Anaszewski; linux-leds@vger.kernel.org; linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; Kernel
> Subject: Re: [PATCH v6 2/2] dt-bindings: leds: lp50xx: Document child reg, fix example
>
> On Mon, Jun 16, 2025 at 01:25:35PM +0200, Johan Adolfsson wrote:
> > The led child reg node is the index within the bank, document that
> > and update the example accordingly.
> >
> > Signed-off-by: Johan Adolfsson <johan.adolfsson@axis.com>
> > ---
> > .../devicetree/bindings/leds/leds-lp50xx.yaml | 21 ++++++++++++++-------
> > 1 file changed, 14 insertions(+), 7 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> > index 402c25424525..cb450aed718c 100644
> > --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> > +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> > @@ -81,7 +81,14 @@ patternProperties:
> >
> >> properties:
> >> reg:
> >> - maxItems: 1
> >> + items:
> >> + - minimum: 0
> >> + maximum: 2
> >> +
> >> + description:
> >> + This property denotes the index within the LED bank.
>
> >> + The value will act as the index in the multi_index file to give
> >> + consistent result independent of devicetree processing order.
> >
> >This looks like commentary on the particulars of the driver
> >implementation in linux, which shouldn't be in a binding.
>
> Just trying to explain what the reg value actually does (and why).
> Before my patch the bindings were there but no code that handled it.
> If the weird reverse processing order wasn't a thing there would not have been a problem.
That's all driver implementation detail that another OS might not care
about if implemented differently, and is therefore not permitted in the
binding. The text about "index within the LED bank" should be sufficient
to describe how the hardware is configured, no?
> >> required:
> >> - reg
> >> @@ -138,18 +145,18 @@ examples:
> >> color = <LED_COLOR_ID_RGB>;
> >> function = LED_FUNCTION_STANDBY;
> >>
> >> - led@3 {
> >> - reg = <0x3>;
> >> + led@0 {
> >> + reg = <0x0>;
> >
> >Do you have any explanation for why these numbers, outside the range you
> >said is valid, were in the binding's example?
>
> No idea, the driver hasn't handled the reg property on the led child until my patch, but
> the property was introduced by this commit:
> commit 3eb229f203c2bc42efbfbafba7f83c8deeca80c9
> Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Date: Tue Jun 7 09:52:46 2022 +0200
>
> dt-bindings: leds: lp50xx: correct reg/unit addresses in example
>
> The multi-led node defined address/size cells, so it is intended to have
> children with unit addresses.
>
> The second multi-led's reg property defined three LED indexes within one
> reg item, which is not correct - these are three separate items.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Link: https://lore.kernel.org/r/20220607075247.58048-1-krzysztof.kozlowski@linaro.org
Right, so random shite that Krzysztof put in, based on the reg property
in the multi-led parent, to satisfy the tooling. It's worth mentioning
in your commit message that these values you're replacing were
speculative.
> >Additionally, can you mention in the commit message what the source was
> >for the 0-2 range?
> The LED driver chip has banks with 3 outputs each, this is how I have interpreted what the code does.
Please put that in the commit message.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2025-06-16 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 11:25 [PATCH v6 0/2] leds-lp50xx: Support reg to set multi_index Johan Adolfsson
2025-06-16 11:25 ` [PATCH v6 1/2] leds: leds-lp50xx: Handle reg to get correct multi_index Johan Adolfsson
2025-06-16 21:29 ` Jacek Anaszewski
2025-06-17 7:23 ` Johan Adolfsson
2025-06-16 11:25 ` [PATCH v6 2/2] dt-bindings: leds: lp50xx: Document child reg, fix example Johan Adolfsson
2025-06-16 15:03 ` Conor Dooley
[not found] ` <PAWPR02MB9281AC0A179DC8526EA074599B70A@PAWPR02MB9281.eurprd02.prod.outlook.com>
2025-06-16 15:56 ` Conor Dooley [this message]
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=20250616-thigh-ferocity-c8e1d7ee18bb@spud \
--to=conor@kernel.org \
--cc=Johan.Adolfsson@axis.com \
--cc=Kernel@axis.com \
--cc=afd@ti.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jacek.anaszewski@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=robh@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