diff mbox series

[net-next,10/11] dt-bindings: net: phy: Document support for LEDs node

Message ID 20230307170046.28917-11-ansuelsmth@gmail.com
State Superseded
Headers show
Series net: Add basic LED support for switch/phy | expand

Commit Message

Christian Marangi March 7, 2023, 5 p.m. UTC
Document support for LEDs node in phy and add an example for it.
PHY LED will have to match led pattern and should be treated as a
generic led.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../devicetree/bindings/net/ethernet-phy.yaml | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Andrew Lunn March 8, 2023, 1:01 a.m. UTC | #1
On Tue, Mar 07, 2023 at 06:00:45PM +0100, Christian Marangi wrote:
> Document support for LEDs node in phy and add an example for it.
> PHY LED will have to match led pattern and should be treated as a
> generic led.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Krzysztof Kozlowski March 8, 2023, 11 a.m. UTC | #2
On 07/03/2023 18:00, Christian Marangi wrote:
> Document support for LEDs node in phy and add an example for it.
> PHY LED will have to match led pattern and should be treated as a
> generic led.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---

Also missing changelog, history, tags, anything. This was already v8.

Also, I have doubts that your patchset is fully bisectable. Are you sure
of this?

Best regards,
Krzysztof
Krzysztof Kozlowski March 8, 2023, 6:56 p.m. UTC | #3
On 08/03/2023 12:00, Krzysztof Kozlowski wrote:
> On 07/03/2023 18:00, Christian Marangi wrote:
>> Document support for LEDs node in phy and add an example for it.
>> PHY LED will have to match led pattern and should be treated as a
>> generic led.
>>
>> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
>> ---
> 
> Also missing changelog, history, tags, anything. This was already v8.
> 
> Also, I have doubts that your patchset is fully bisectable. Are you sure
> of this?

OK, so the leds in previous patch are not for phy but for port, so it is
properly bisectable.

Best regards,
Krzysztof
Krzysztof Kozlowski March 8, 2023, 6:56 p.m. UTC | #4
On 07/03/2023 18:00, Christian Marangi wrote:
> Document support for LEDs node in phy and add an example for it.
> PHY LED will have to match led pattern and should be treated as a
> generic led.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  .../devicetree/bindings/net/ethernet-phy.yaml | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> index 1327b81f15a2..0ec8ef6b0d8a 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> @@ -197,6 +197,13 @@ properties:
>        PHY's that have configurable TX internal delays. If this property is
>        present then the PHY applies the TX delay.
>  
> +  leds:
> +    type: object

additionalProperties: false

although maybe this was already said in one of previous ten reviews...

> +
> +    patternProperties:
> +      '^led(@[a-f0-9]+)?$':
> +        $ref: /schemas/leds/common.yaml#
> +


Best regards,
Krzysztof
Christian Marangi March 8, 2023, 7:03 p.m. UTC | #5
On Wed, Mar 08, 2023 at 07:56:57PM +0100, Krzysztof Kozlowski wrote:
> On 07/03/2023 18:00, Christian Marangi wrote:
> > Document support for LEDs node in phy and add an example for it.
> > PHY LED will have to match led pattern and should be treated as a
> > generic led.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  .../devicetree/bindings/net/ethernet-phy.yaml | 22 +++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> > index 1327b81f15a2..0ec8ef6b0d8a 100644
> > --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> > +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> > @@ -197,6 +197,13 @@ properties:
> >        PHY's that have configurable TX internal delays. If this property is
> >        present then the PHY applies the TX delay.
> >  
> > +  leds:
> > +    type: object
> 
> additionalProperties: false
> 
> although maybe this was already said in one of previous ten reviews...
>

Thanks for the review. (this is rather new from the old patch (appeared
only in v7 so sorry if I didn't see that in the old series. Will fix in
v2 of this!)

> > +
> > +    patternProperties:
> > +      '^led(@[a-f0-9]+)?$':
> > +        $ref: /schemas/leds/common.yaml#
> > +
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 1327b81f15a2..0ec8ef6b0d8a 100644
--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
@@ -197,6 +197,13 @@  properties:
       PHY's that have configurable TX internal delays. If this property is
       present then the PHY applies the TX delay.
 
+  leds:
+    type: object
+
+    patternProperties:
+      '^led(@[a-f0-9]+)?$':
+        $ref: /schemas/leds/common.yaml#
+
 required:
   - reg
 
@@ -204,6 +211,8 @@  additionalProperties: true
 
 examples:
   - |
+    #include <dt-bindings/leds/common.h>
+
     ethernet {
         #address-cells = <1>;
         #size-cells = <0>;
@@ -219,5 +228,18 @@  examples:
             reset-gpios = <&gpio1 4 1>;
             reset-assert-us = <1000>;
             reset-deassert-us = <2000>;
+
+            leds {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                led@0 {
+                    reg = <0>;
+                    color = <LED_COLOR_ID_WHITE>;
+                    function = LED_FUNCTION_LAN;
+                    function-enumerator = <1>;
+                    default-state = "keep";
+                };
+            };
         };
     };