Skip to contentSkip to conversation

dt-bindings: usb: cdns,usb3: use common usb-drd yaml

PATCH Superseded Frank Li 2 participants 2 messages Jun 6, 2024 – Jun 7, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: usb: cdns,usb3: use common usb-drd yaml

Use common usb-drd yaml for usb OTG related propteries. Allow propertry "usb-role-switch" to fix below DTB_CHECK warning.

arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb: usb@5b110000: usb@5b120000: 'port', 'usb-role-switch' do not match any of the regexes: 'pinctrl-[0-9]+'

Add "port" proptery to use connect type C connector and fix below warning. arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb: usb@5b110000: usb@5b120000: Unevaluated properties are not allowed ('port' was unexpected)

---

Notes:
pass dt_binding_check

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 dt_binding_check DT_SCHEMA_FILES=cdns,usb3.yaml
SCHEMA Documentation/devicetree/bindings/processed-schema.json
CHKDT Documentation/devicetree/bindings
LINT Documentation/devicetree/bindings
DTEX Documentation/devicetree/bindings/usb/cdns,usb3.example.dts
DTC_CHK Documentation/devicetree/bindings/usb/cdns,usb3.example.dtb

 .../devicetree/bindings/usb/cdns,usb3.yaml       | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/usb/cdns,usb3.yaml +13 -3
index 69a93a0722f07..38df19bad7c41 100644
@@ -42,8 +42,15 @@ properties:
       - const: otg
       - const: wakeup
 
-  dr_mode:
-    enum: [host, otg, peripheral]
+  dr_mode: true
+
+  usb-role-switch: true
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      This port is used with the 'usb-role-switch' property  to connect the
+      cdns3 to type C connector.
 
   maximum-speed:
     enum: [super-speed, high-speed, full-speed]
@@ -77,7 +84,10 @@ required:
   - interrupts
   - interrupt-names
 
-additionalProperties: false
+allOf:
+  - $ref: usb-drd.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 1 line
2.34.1
#1 lore raw
Quoted 29 lines · Frank Li

Use common usb-drd yaml for usb OTG related propteries. Allow propertry "usb-role-switch" to fix below DTB_CHECK warning.

arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb: usb@5b110000: usb@5b120000: 'port', 'usb-role-switch' do not match any of the regexes: 'pinctrl-[0-9]+'

Add "port" proptery to use connect type C connector and fix below warning. arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb: usb@5b110000: usb@5b120000: Unevaluated properties are not allowed ('port' was unexpected)

---

Notes:
pass dt_binding_check

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 dt_binding_check DT_SCHEMA_FILES=cdns,usb3.yaml
SCHEMA Documentation/devicetree/bindings/processed-schema.json
CHKDT Documentation/devicetree/bindings
LINT Documentation/devicetree/bindings
DTEX Documentation/devicetree/bindings/usb/cdns,usb3.example.dts
DTC_CHK Documentation/devicetree/bindings/usb/cdns,usb3.example.dtb

 .../devicetree/bindings/usb/cdns,usb3.yaml       | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/usb/cdns,usb3.yaml +0 -0
index 69a93a0722f07..38df19bad7c41 100644

Documentation/devicetree/bindings/usb/cdns,usb3.yaml properties: · line 47

Quoted 8 lines
Documentation/devicetree/bindings/usb/cdns,usb3.yaml +3 -2
@@ -42,8 +42,15 @@ properties:
       - const: otg
       - const: wakeup
 
-  dr_mode:
-    enum: [host, otg, peripheral]
+  dr_mode: true
+
+  usb-role-switch: true

These two should not be needed now (usage of unevaluatedProps allows them), just drop them.

Documentation/devicetree/bindings/usb/cdns,usb3.yaml required: · line 85

Quoted 12 lines
Documentation/devicetree/bindings/usb/cdns,usb3.yaml +6 -0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      This port is used with the 'usb-role-switch' property  to connect the
+      cdns3 to type C connector.
 
   maximum-speed:
     enum: [super-speed, high-speed, full-speed]
@@ -77,7 +84,10 @@ required:
   - interrupts
   - interrupt-names

Missing dependency on "port", see other bindings like dwc2.

Best regards,
Krzysztof