diff mbox series

[3/5] dt-bindings: net: ipq4019-mdio: require and validate clocks

Message ID 20221113184727.44923-3-robimarko@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/5] dt-bindings: net: ipq4019-mdio: document IPQ6018 compatible | expand

Commit Message

Robert Marko Nov. 13, 2022, 6:47 p.m. UTC
Now that we can match the platforms requiring clocks by compatible start
using those to allow clocks per compatible and make them required.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 .../bindings/net/qcom,ipq4019-mdio.yaml       | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)

Comments

Krzysztof Kozlowski Nov. 14, 2022, 8:29 a.m. UTC | #1
On 13/11/2022 19:47, Robert Marko wrote:
> Now that we can match the platforms requiring clocks by compatible start
> using those to allow clocks per compatible and make them required.
> 
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
>  .../bindings/net/qcom,ipq4019-mdio.yaml       | 28 +++++++++++++------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
> index 2c85ae43d27d..b34955b0b827 100644
> --- a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
> @@ -9,9 +9,6 @@ title: Qualcomm IPQ40xx MDIO Controller
>  maintainers:
>    - Robert Marko <robert.marko@sartura.hr>
>  
> -allOf:
> -  - $ref: "mdio.yaml#"
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -40,18 +37,31 @@ properties:
>        the second Address and length of the register for ethernet LDO, this second
>        address range is only required by the platform IPQ50xx.
>  
> -  clocks:
> -    maxItems: 1

Keep it here.

> -    description: |
> -      MDIO clock source frequency fixed to 100MHZ, this clock should be specified
> -      by the platform IPQ807x, IPQ60xx and IPQ50xx.
> -
>  required:
>    - compatible
>    - reg
>    - "#address-cells"
>    - "#size-cells"
>  
> +allOf:
> +  - $ref: "mdio.yaml#"
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - qcom,ipq5018-mdio
> +              - qcom,ipq6018-mdio
> +              - qcom,ipq8074-mdio
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: MDIO clock source frequency fixed to 100MHZ
> +      required:
> +        - clocks

else:
  properties:
    clocks: false

> +
>  unevaluatedProperties: false
>  
>  examples:

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
index 2c85ae43d27d..b34955b0b827 100644
--- a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml
@@ -9,9 +9,6 @@  title: Qualcomm IPQ40xx MDIO Controller
 maintainers:
   - Robert Marko <robert.marko@sartura.hr>
 
-allOf:
-  - $ref: "mdio.yaml#"
-
 properties:
   compatible:
     oneOf:
@@ -40,18 +37,31 @@  properties:
       the second Address and length of the register for ethernet LDO, this second
       address range is only required by the platform IPQ50xx.
 
-  clocks:
-    maxItems: 1
-    description: |
-      MDIO clock source frequency fixed to 100MHZ, this clock should be specified
-      by the platform IPQ807x, IPQ60xx and IPQ50xx.
-
 required:
   - compatible
   - reg
   - "#address-cells"
   - "#size-cells"
 
+allOf:
+  - $ref: "mdio.yaml#"
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,ipq5018-mdio
+              - qcom,ipq6018-mdio
+              - qcom,ipq8074-mdio
+    then:
+      properties:
+        clocks:
+          items:
+            - description: MDIO clock source frequency fixed to 100MHZ
+      required:
+        - clocks
+
 unevaluatedProperties: false
 
 examples: