Change reg, interrupts, clock and clock-names as common properties and add restrictions on them for different compatibles. Signed-off-by: Xu Yang <xu.yang_2@xxxxxxx> --- 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 --- .../devicetree/bindings/usb/ci-hdrc-usb2.yaml | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml index 3b56e0edb1c6..6ad3582051b8 100644 --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml @@ -412,6 +412,124 @@ allOf: samsung,picophy-pre-emp-curr-control: false samsung,picophy-dc-vol-level-adjust: false + - if: + properties: + compatible: + const: fsl,imx27-usb + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + minItems: 3 + maxItems: 3 + items: + anyOf: + - const: ipg + - const: ahb + - const: per + + - if: + properties: + compatible: + contains: + enum: + - fsl,imx25-usb + - fsl,imx35-usb + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + minItems: 3 + maxItems: 3 + items: + anyOf: + - const: ipg + - const: ahb + - const: per + + - if: + properties: + compatible: + contains: + enum: + - qcom,ci-hdrc + then: + properties: + reg: + minItems: 2 + maxItems: 2 + interrupts: + minItems: 1 + maxItems: 2 + clocks: + minItems: 2 + maxItems: 3 + clock-names: + minItems: 2 + maxItems: 3 + items: + anyOf: + - const: core + - const: iface + - const: fs + description: optional + + - if: + properties: + compatible: + contains: + enum: + - chipidea,usb2 + - fsl,imx23-usb + - fsl,imx28-usb + - fsl,imx7d-usb + - fsl,vf610-usb + then: + properties: + clocks: + minItems: 1 + maxItems: 1 + clock-names: + minItems: 1 + maxItems: 1 + + - if: + properties: + compatible: + contains: + oneOf: + - pattern: '^fsl,imx5[0-3]+-usb$' + - pattern: '^fsl,imx6[a-z]+-usb$' + then: + properties: + clocks: + minItems: 1 + maxItems: 1 + clock-names: + minItems: 1 + maxItems: 1 + + - if: + properties: + compatible: + contains: + enum: + - chipidea,usb2 + - fsl,imx27-usb + - fsl,imx6ul-usb + then: + properties: + reg: + minItems: 1 + maxItems: 1 + interrupts: + minItems: 1 + maxItems: 1 + unevaluatedProperties: false examples: -- 2.34.1