diff mbox series

[v8,12/13] dt-bindings: net: phy: Document support for leds node

Message ID 20230216013230.22978-13-ansuelsmth@gmail.com
State Superseded
Headers show
Series Adds support for PHY LEDs with offload triggers | expand

Commit Message

Christian Marangi Feb. 16, 2023, 1:32 a.m. UTC
Document support for leds node in phy and add an example for it.
Phy led will have to match led-phy 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

Rob Herring Feb. 16, 2023, 2:32 a.m. UTC | #1
On Thu, 16 Feb 2023 02:32:29 +0100, Christian Marangi wrote:
> Document support for leds node in phy and add an example for it.
> Phy led will have to match led-phy 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(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.example.dtb: ethernet-phy@0: leds:led-phy@0:linux,default-trigger: 'oneOf' conditional failed, one must be fixed:
	'netdev' is not one of ['backlight', 'default-on', 'heartbeat', 'disk-activity', 'ide-disk', 'timer', 'pattern']
	'netdev' does not match '^mmc[0-9]+$'
	'netdev' does not match '^cpu[0-9]*$'
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230216013230.22978-13-ansuelsmth@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Christian Marangi Feb. 16, 2023, 10 a.m. UTC | #2
On Wed, Feb 15, 2023 at 08:32:11PM -0600, Rob Herring wrote:
> 
> On Thu, 16 Feb 2023 02:32:29 +0100, Christian Marangi wrote:
> > Document support for leds node in phy and add an example for it.
> > Phy led will have to match led-phy 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(+)
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.example.dtb: ethernet-phy@0: leds:led-phy@0:linux,default-trigger: 'oneOf' conditional failed, one must be fixed:
> 	'netdev' is not one of ['backlight', 'default-on', 'heartbeat', 'disk-activity', 'ide-disk', 'timer', 'pattern']
> 	'netdev' does not match '^mmc[0-9]+$'
> 	'netdev' does not match '^cpu[0-9]*$'
> 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> 

Hi, I could be wrong but this should be fixed by the previous patch that
adds netdev to the trigger list.

> doc reference errors (make refcheckdocs):
> 
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230216013230.22978-13-ansuelsmth@gmail.com
> 
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your schema.
>
Rob Herring Feb. 17, 2023, 11:10 p.m. UTC | #3
On Thu, Feb 16, 2023 at 11:00:49AM +0100, Christian Marangi wrote:
> On Wed, Feb 15, 2023 at 08:32:11PM -0600, Rob Herring wrote:
> > 
> > On Thu, 16 Feb 2023 02:32:29 +0100, Christian Marangi wrote:
> > > Document support for leds node in phy and add an example for it.
> > > Phy led will have to match led-phy 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(+)
> > > 
> > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.example.dtb: ethernet-phy@0: leds:led-phy@0:linux,default-trigger: 'oneOf' conditional failed, one must be fixed:
> > 	'netdev' is not one of ['backlight', 'default-on', 'heartbeat', 'disk-activity', 'ide-disk', 'timer', 'pattern']
> > 	'netdev' does not match '^mmc[0-9]+$'
> > 	'netdev' does not match '^cpu[0-9]*$'
> > 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> > 
> 
> Hi, I could be wrong but this should be fixed by the previous patch that
> adds netdev to the trigger list.

If so, then it didn't apply for me which is what PW says. So what tree 
does this series apply too? linux-next? That's a tree no one can apply 
patches from.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 1327b81f15a2..34a5a688c13b 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-phy(@[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-phy@0 {
+                    reg = <0>;
+                    color = <LED_COLOR_ID_WHITE>;
+                    function = LED_FUNCTION_LAN;
+                    function-enumerator = <1>;
+                    linux,default-trigger = "netdev";
+                };
+            };
         };
     };