2021-04-29 19:29:13

by Corentin LABBE

[permalink] [raw]
Subject: [PATCH v2] dt-bindings: net: Convert mdio-gpio to yaml

Converts net/mdio-gpio.txt to yaml

Signed-off-by: Corentin Labbe <[email protected]>
---
Changes since v1:
- fixes yamllint warning about indent
- added maxItems 3

.../devicetree/bindings/net/mdio-gpio.txt | 27 ---------
.../devicetree/bindings/net/mdio-gpio.yaml | 57 +++++++++++++++++++
2 files changed, 57 insertions(+), 27 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/net/mdio-gpio.txt
create mode 100644 Documentation/devicetree/bindings/net/mdio-gpio.yaml

diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt
deleted file mode 100644
index 4d91a36c5cf5..000000000000
--- a/Documentation/devicetree/bindings/net/mdio-gpio.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-MDIO on GPIOs
-
-Currently defined compatibles:
-- virtual,gpio-mdio
-- microchip,mdio-smi0
-
-MDC and MDIO lines connected to GPIO controllers are listed in the
-gpios property as described in section VIII.1 in the following order:
-
-MDC, MDIO.
-
-Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
-node.
-
-Example:
-
-aliases {
- mdio-gpio0 = &mdio0;
-};
-
-mdio0: mdio {
- compatible = "virtual,mdio-gpio";
- #address-cells = <1>;
- #size-cells = <0>;
- gpios = <&qe_pio_a 11
- &qe_pio_c 6>;
-};
diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.yaml b/Documentation/devicetree/bindings/net/mdio-gpio.yaml
new file mode 100644
index 000000000000..70103ef17f53
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-gpio.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/mdio-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MDIO on GPIOs
+
+maintainers:
+ - Andrew Lunn <[email protected]>
+ - Florian Fainelli <[email protected]>
+ - Heiner Kallweit <[email protected]>
+
+allOf:
+ - $ref: "mdio.yaml#"
+
+properties:
+ compatible:
+ enum:
+ - virtual,mdio-gpio
+ - microchip,mdio-smi0
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ gpios:
+ minItems: 2
+ maxItems: 3
+ description: |
+ MDC and MDIO lines connected to GPIO controllers are listed in
+ the gpios property as described in section VIII.1 in the
+ following order: MDC, MDIO.
+
+#Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
+#node.
+unevaluatedProperties: false
+
+examples:
+ - |
+ aliases {
+ mdio-gpio0 = &mdio0;
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qe_pio_a 11
+ &qe_pio_c 6>;
+ ethphy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+...
--
2.26.3


2021-04-29 21:23:01

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: net: Convert mdio-gpio to yaml

On Thu, Apr 29, 2021 at 07:23:26PM +0000, Corentin Labbe wrote:
> Converts net/mdio-gpio.txt to yaml
>
> Signed-off-by: Corentin Labbe <[email protected]>

For the basic information contents:

Reviewed-by: Andrew Lunn <[email protected]>

I cannot say anything about the YAML.

Andrew

2021-05-06 08:44:38

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: net: Convert mdio-gpio to yaml

On Thu, Apr 29, 2021 at 9:24 PM Corentin Labbe <[email protected]> wrote:

> Converts net/mdio-gpio.txt to yaml
>
> Signed-off-by: Corentin Labbe <[email protected]>

This v2 looks good to me, I suppose you will need to wait for
net-next to open and resend it with "net-next" in the subject
though.
Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij