diff mbox series

[1/2] dt-bindings: leds: lp50xx: correct reg/unit addresses in example

Message ID 20220518082215.14358-1-krzysztof.kozlowski@linaro.org
State Superseded
Headers show
Series [1/2] dt-bindings: leds: lp50xx: correct reg/unit addresses in example | expand

Commit Message

Krzysztof Kozlowski May 18, 2022, 8:22 a.m. UTC
The multi-led node defined address/size cells, so it 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>

---

Cc: Kyle Swenson <kyle.swenson@est.tech>
---
 .../devicetree/bindings/leds/leds-lp50xx.yaml | 22 ++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)

Comments

Rob Herring (Arm) May 23, 2022, 9:35 p.m. UTC | #1
On Wed, May 18, 2022 at 10:22:14AM +0200, Krzysztof Kozlowski wrote:
> The multi-led node defined address/size cells, so it 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>
> 
> ---
> 
> Cc: Kyle Swenson <kyle.swenson@est.tech>
> ---
>  .../devicetree/bindings/leds/leds-lp50xx.yaml | 22 ++++++++++++-------
>  1 file changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> index f12fe5b53f30..dc1ac905bb91 100644
> --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> @@ -99,35 +99,41 @@ examples:
>                 color = <LED_COLOR_ID_RGB>;
>                 function = LED_FUNCTION_CHARGING;
>  
> -               led-0 {
> +               led@0 {
> +                   reg = <0x0>;
>                     color = <LED_COLOR_ID_RED>;
>                 };
>  
> -               led-1 {
> +               led@1 {
> +                   reg = <0x1>;
>                     color = <LED_COLOR_ID_GREEN>;
>                 };
>  
> -               led-2 {
> +               led@2 {
> +                   reg = <0x2>;
>                     color = <LED_COLOR_ID_BLUE>;
>                 };
>            };
>  
>            multi-led@2 {
>              #address-cells = <1>;
> -            #size-cells = <2>;
> -            reg = <0x2 0x3 0x5>;
> +            #size-cells = <0>;
> +            reg = <0x3>, <0x4>, <0x5>;

The unit-address is 2, but the reg value is 3?

>              color = <LED_COLOR_ID_RGB>;
>              function = LED_FUNCTION_STANDBY;
>  
> -            led-6 {
> +            led@3 {
> +              reg = <0x3>;
>                color = <LED_COLOR_ID_RED>;
>              };
>  
> -            led-7 {
> +            led@4 {
> +              reg = <0x4>;
>                color = <LED_COLOR_ID_GREEN>;
>              };
>  
> -            led-8 {
> +            led@5 {
> +              reg = <0x5>;
>                color = <LED_COLOR_ID_BLUE>;
>              };
>           };
> -- 
> 2.32.0
> 
>
Krzysztof Kozlowski May 24, 2022, 6:36 a.m. UTC | #2
On 23/05/2022 23:35, Rob Herring wrote:
> On Wed, May 18, 2022 at 10:22:14AM +0200, Krzysztof Kozlowski wrote:
>> The multi-led node defined address/size cells, so it 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>
>>
>> ---
>>
>> Cc: Kyle Swenson <kyle.swenson@est.tech>
>> ---
>>  .../devicetree/bindings/leds/leds-lp50xx.yaml | 22 ++++++++++++-------
>>  1 file changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
>> index f12fe5b53f30..dc1ac905bb91 100644
>> --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
>> +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
>> @@ -99,35 +99,41 @@ examples:
>>                 color = <LED_COLOR_ID_RGB>;
>>                 function = LED_FUNCTION_CHARGING;
>>  
>> -               led-0 {
>> +               led@0 {
>> +                   reg = <0x0>;
>>                     color = <LED_COLOR_ID_RED>;
>>                 };
>>  
>> -               led-1 {
>> +               led@1 {
>> +                   reg = <0x1>;
>>                     color = <LED_COLOR_ID_GREEN>;
>>                 };
>>  
>> -               led-2 {
>> +               led@2 {
>> +                   reg = <0x2>;
>>                     color = <LED_COLOR_ID_BLUE>;
>>                 };
>>            };
>>  
>>            multi-led@2 {
>>              #address-cells = <1>;
>> -            #size-cells = <2>;
>> -            reg = <0x2 0x3 0x5>;
>> +            #size-cells = <0>;
>> +            reg = <0x3>, <0x4>, <0x5>;
> 
> The unit-address is 2, but the reg value is 3?

Right, the multi-led should be also @3 to match the reg and first led in
children.

Thanks.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
index f12fe5b53f30..dc1ac905bb91 100644
--- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
@@ -99,35 +99,41 @@  examples:
                color = <LED_COLOR_ID_RGB>;
                function = LED_FUNCTION_CHARGING;
 
-               led-0 {
+               led@0 {
+                   reg = <0x0>;
                    color = <LED_COLOR_ID_RED>;
                };
 
-               led-1 {
+               led@1 {
+                   reg = <0x1>;
                    color = <LED_COLOR_ID_GREEN>;
                };
 
-               led-2 {
+               led@2 {
+                   reg = <0x2>;
                    color = <LED_COLOR_ID_BLUE>;
                };
           };
 
           multi-led@2 {
             #address-cells = <1>;
-            #size-cells = <2>;
-            reg = <0x2 0x3 0x5>;
+            #size-cells = <0>;
+            reg = <0x3>, <0x4>, <0x5>;
             color = <LED_COLOR_ID_RGB>;
             function = LED_FUNCTION_STANDBY;
 
-            led-6 {
+            led@3 {
+              reg = <0x3>;
               color = <LED_COLOR_ID_RED>;
             };
 
-            led-7 {
+            led@4 {
+              reg = <0x4>;
               color = <LED_COLOR_ID_GREEN>;
             };
 
-            led-8 {
+            led@5 {
+              reg = <0x5>;
               color = <LED_COLOR_ID_BLUE>;
             };
          };