diff mbox series

[v2] dt-bindings: leds: Allow differently named multicolor leds

Message ID 20250412-multi-led-v2-1-56af86908744@posteo.net
State New
Headers show
Series [v2] dt-bindings: leds: Allow differently named multicolor leds | expand

Commit Message

J. Neuschäfer via B4 Relay April 12, 2025, 1:04 p.m. UTC
From: "J. Neuschäfer" <j.ne@posteo.net>

In some cases, for example when using multiple instances of
leds-group-multicolor, a board may have multiple multi-leds which can't
be distinguished by unit address. In such cases it should be possible to
name them differently, for example multi-led-a and multi-led-b. This
patch adds another node name pattern to leds-class-multicolor.yaml to
allow such names.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
---
V2:
- Add Krzysztof's review tag
- mention leds-group-multicolor in the commit message
- rebase on 6.15-rc1

Link to v1: https://lore.kernel.org/r/20250209-multi-led-v1-1-5aebccbd2db7@posteo.net
---
 Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250209-multi-led-9991e205befd

Best regards,

Comments

J. Neuschäfer April 17, 2025, 2:35 p.m. UTC | #1
On Sat, Apr 12, 2025 at 12:12:37PM -0500, Rob Herring wrote:
> On Sat, Apr 12, 2025 at 03:04:32PM +0200, J. Neuschäfer wrote:
> > In some cases, for example when using multiple instances of
> > leds-group-multicolor, a board may have multiple multi-leds which can't
> > be distinguished by unit address. In such cases it should be possible to
> > name them differently, for example multi-led-a and multi-led-b. This
> > patch adds another node name pattern to leds-class-multicolor.yaml to
> > allow such names.
> 
> Really, multi-led-0, multi-led-1, etc. would be preferred like we have 
> in other places.

I'll change the examples to -0, -1. I'm also open to restricting the
pattern to something else than -.+

> 
> > 
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
> > ---
> > V2:
> > - Add Krzysztof's review tag
> > - mention leds-group-multicolor in the commit message
> > - rebase on 6.15-rc1
> > 
> > Link to v1: https://lore.kernel.org/r/20250209-multi-led-v1-1-5aebccbd2db7@posteo.net
> > ---
> >  Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
> > index bb40bb9e036ee00e06d21e2321ecd5a7d471c408..c22af25b6430be71300c0e37f696cd61112ea190 100644
> > --- a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
> > +++ b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
> > @@ -21,7 +21,9 @@ description: |
> >  
> >  properties:
> >    $nodename:
> > -    pattern: "^multi-led(@[0-9a-f])?$"
> > +    oneOf:
> > +      - pattern: "^multi-led(@[0-9a-f])?$"
> > +      - pattern: "^multi-led-.*$"
> 
> Combine these:
> 
> '^multi-led(-.+|@[0-9a-f])?$'
> 
> oneOf is best avoided because the error messages aren't so great.

Alright, I'll change that.

> 
> >  
> >    color:
> >      description: |
> > 
> > ---
> > base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> > change-id: 20250209-multi-led-9991e205befd
> > 
> > Best regards,
> > -- 
> > J. Neuschäfer <j.ne@posteo.net>
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
index bb40bb9e036ee00e06d21e2321ecd5a7d471c408..c22af25b6430be71300c0e37f696cd61112ea190 100644
--- a/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml
@@ -21,7 +21,9 @@  description: |
 
 properties:
   $nodename:
-    pattern: "^multi-led(@[0-9a-f])?$"
+    oneOf:
+      - pattern: "^multi-led(@[0-9a-f])?$"
+      - pattern: "^multi-led-.*$"
 
   color:
     description: |