diff mbox series

[v6,5/9] dt-bindings: usb: ci-hdrc-usb2-imx: add restrictions for reg, interrupts, clock and clock-names properties

Message ID 20240221145846.1611627-5-xu.yang_2@nxp.com
State Superseded
Headers show
Series [v6,1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible | expand

Commit Message

Xu Yang Feb. 21, 2024, 2:58 p.m. UTC
Add restrictions for reg, interrupts, clock and clock-names properties
for imx Socs.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v4:
 - new patch since v3's discussion
 - split the reg, interrupts, clock and clock-names properties into
   common part and device-specific
Changes in v5:
 - keep common property unchanged
 - make if-then more readable
 - remove non imx part
Changes in v6:
 - new patch based on ci-hdrc-usb2-imx.yaml
---
 .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
index 2ec62f564bf5..20bb048938ff 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
@@ -49,11 +49,63 @@  properties:
           - const: fsl,imx6ul-usb
           - const: fsl,imx27-usb
 
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
 allOf:
   - $ref: ci-hdrc-usb2.yaml#
 
+  # imx27 Soc needs three clocks
+  - if:
+      properties:
+        compatible:
+          const: fsl,imx27-usb
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: ipg
+            - const: ahb
+            - const: per
+    else:
+      # imx25 and imx35 Soc need three clocks
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - fsl,imx25-usb
+                - fsl,imx35-usb
+      then:
+        properties:
+          clocks:
+            minItems: 3
+            maxItems: 3
+          clock-names:
+            items:
+              - const: ipg
+              - const: ahb
+              - const: per
+      else:
+        # other imx Socs only need one clock
+        properties:
+          clocks:
+            minItems: 1
+            maxItems: 1
+          clock-names:
+            minItems: 1
+            maxItems: 1
+
 required:
   - compatible
+  - reg
+  - interrupts
 
 unevaluatedProperties: false