Skip to contentSkip to conversation

dt-bindings: extcon: ptn5150: add child node port

PATCH Superseded Frank Li 2 participants 3 messages Aug 15, 2024 – Aug 16, 2024

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH v2 1/1 dt-bindings: extcon: ptn5150: add child node port

Add child node 'port' to allow connect to usb controller to do role-switch. Add example for id pin of ptn5150 have not connect to main chip's usb id pin.

Fix below warning:
arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dtb: typec@3d: 'port' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/extcon/extcon-ptn5150.yaml

---
Change from v1 to v2
- add example for id pin have not connect to main chip's id example.
- commit 095b96b2b fix "port" warning, but add new warning "connector" is not exist. And follow commit revert this change.
690085d866f08 Revert "arm64: dts: imx8mn-var-som-symphony: Describe the USB-C connector
- I have not board in hand to debug why "connector" is not work.

---
 .../bindings/extcon/extcon-ptn5150.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +46 -0
index d5cfa32ea52dd..39231f9952826 100644
@@ -37,6 +37,11 @@ properties:
       GPIO pin (output) used to control VBUS. If skipped, no such control
       takes place.
 
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      A port node to link the usb controller for the dual role switch.
+
 required:
   - compatible
   - interrupts
@@ -60,3 +65,44 @@ examples:
             vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
         };
     };
+
+  - |
+    /* id pin of ptn5150 have not connected to chip's id pin */
+    #include <dt-bindings/clock/imx8mn-clock.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ptn5150@1d {
+            compatible = "nxp,ptn5150";
+            reg = <0x1d>;
+            interrupt-parent = <&msmgpio>;
+            interrupts = <78 IRQ_TYPE_LEVEL_HIGH>;
+            vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
+
+            port {
+                    typec1_dr_sw: endpoint {
+                    remote-endpoint = <&usb1_drd_sw>;
+                 };
+            };
+        };
+    };
+
+    usb@32e40000 {
+        compatible = "fsl,imx8mn-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
+        reg = <0x32e40000 0x200>;
+        interrupts = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk IMX8MN_CLK_USB1_CTRL_ROOT>;
+        usb-role-switch;
+
+        port {
+             usb1_drd_sw: endpoint {
+                  remote-endpoint = <&typec1_dr_sw>;
+             };
+        };
+    };
+
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · Frank Li

Add child node 'port' to allow connect to usb controller to do role-switch. Add example for id pin of ptn5150 have not connect to main chip's usb id pin.

Fix below warning:
arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dtb: typec@3d: 'port' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/extcon/extcon-ptn5150.yaml

---
Change from v1 to v2
- add example for id pin have not connect to main chip's id example.
- commit 095b96b2b fix "port" warning, but add new warning "connector" is not exist. And follow commit revert this change.
690085d866f08 Revert "arm64: dts: imx8mn-var-som-symphony: Describe the USB-C connector
- I have not board in hand to debug why "connector" is not work.

Quoted 4 lines
---
 .../bindings/extcon/extcon-ptn5150.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/extcon/extcon-ptn5150.example.dtb: usb@32e40000: interrupts: [[4294967295, 0], [40, 4]] is too long
from schema $id: http://devicetree.org/schemas/usb/chipidea,usb2-imx.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

maintainer
#2 lore raw
In reply to Frank Li
Quoted 37 lines · Frank Li

Add child node 'port' to allow connect to usb controller to do role-switch. Add example for id pin of ptn5150 have not connect to main chip's usb id pin.

Fix below warning:
arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dtb: typec@3d: 'port' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/extcon/extcon-ptn5150.yaml

---
Change from v1 to v2
- add example for id pin have not connect to main chip's id example.
- commit 095b96b2b fix "port" warning, but add new warning "connector" is not exist. And follow commit revert this change.
690085d866f08 Revert "arm64: dts: imx8mn-var-som-symphony: Describe the USB-C connector
- I have not board in hand to debug why "connector" is not work.

---
 .../bindings/extcon/extcon-ptn5150.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +5 -0
index d5cfa32ea52dd..39231f9952826 100644
@@ -37,6 +37,11 @@ properties:
       GPIO pin (output) used to control VBUS. If skipped, no such control
       takes place.
 
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      A port node to link the usb controller for the dual role switch.
+
 required:
   - compatible
   - interrupts

Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml examples: · line 74

Quoted 10 lines
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +7 -0
@@ -60,3 +65,44 @@ examples:
             vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
         };
     };
+
+  - |
+    /* id pin of ptn5150 have not connected to chip's id pin */
+    #include <dt-bindings/clock/imx8mn-clock.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/gpio/gpio.h>

Just add 'port' to the existing example if you want to. Don't need a whole other example just for that.

Quoted 37 lines
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +34 -0
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ptn5150@1d {
+            compatible = "nxp,ptn5150";
+            reg = <0x1d>;
+            interrupt-parent = <&msmgpio>;
+            interrupts = <78 IRQ_TYPE_LEVEL_HIGH>;
+            vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
+
+            port {
+                    typec1_dr_sw: endpoint {
+                    remote-endpoint = <&usb1_drd_sw>;
+                 };
+            };
+        };
+    };
+
+    usb@32e40000 {
+        compatible = "fsl,imx8mn-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
+        reg = <0x32e40000 0x200>;
+        interrupts = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk IMX8MN_CLK_USB1_CTRL_ROOT>;
+        usb-role-switch;
+
+        port {
+             usb1_drd_sw: endpoint {
+                  remote-endpoint = <&typec1_dr_sw>;
+             };
+        };
+    };
+
Signature · 1 line
2.34.1