Skip to contentSkip to conversation

usb: typec: ucsi_ccg: Add CYPD6129/CYPD6229 support

PATCH In review Akash Kumar 3 participants 6 messages Oct 12

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover usb: typec: ucsi_ccg: Add CYPD6129/CYPD6229 support

This series adds Device Tree and driver support for the Cypress CYPD6129 and CYPD6229 dual Type-C PD controllers.

The controllers use the existing I2C-based UCSI CCG interface. The series updates the binding to describe the new compatibles and controller-specific properties, and extends the UCSI CCG OF match table accordingly.

Patch 1 updates the Device Tree binding to:
- Add CYPD6129 and CYPD6229 compatible strings.
- Support the CYPD6229 fallback-compatible relationship with CYPD6129.
- Allow controller-specific I2C addresses and interrupt configurations.
- Add pinctrl and wakeup-source properties.
- Preserve the existing CYPD4226-specific constraints.

Patch 2 adds CYPD6129 and CYPD6229 to the UCSI CCG OF device ID table.

Changes in v3:
- Fold the new controller descriptions into the existing cypress,cypd4226.yaml binding.
- Drop the standalone cypress,cypd6129.yaml binding file.
- Drop the Shikra DTS changes from this series.
- Add conditional binding constraints for CYPD4226 and CYPD6129/CYPD6229.
- Address review comments from the v1 submission.

Link to v2: Link: https://lore.kernel.org/all/[email protected]/

Link to v1: https://lore.kernel.org/all/[email protected]/

Akash Kumar (2):
dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support
usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs

 .../bindings/usb/cypress,cypd4226.yaml        | 90 +++++++++++++++++--
 drivers/usb/typec/ucsi/ucsi_ccg.c             |  2 +
 2 files changed, 85 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/2 dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support

From: Akash Kumar <[email protected]>

Extend the binding to cover the Cypress cypd6129 and cypd6229 dual Type-C PD controllers, which share the same I2C-controlled interface as the cypd4226. Also add pinctrl and wakeup-source properties, and relax reg/interrupts constraints that only applied to cypd4226.

---
 .../bindings/usb/cypress,cypd4226.yaml        | 90 +++++++++++++++++--
 1 file changed, 83 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml +83 -7
index 0620d82508c1..d923ef82ecfa 100644
@@ -4,18 +4,25 @@
 $id: http://devicetree.org/schemas/usb/cypress,cypd4226.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Cypress cypd4226 Type-C Controller
+title: Cypress cypd4226/cypd6129/cypd6229 Type-C Controller
 
 maintainers:
   - Wayne Chang <[email protected]>
+  - Akash Kumar <[email protected]>
 
 description:
-  The Cypress cypd4226 is a dual Type-C controller that is controlled
-  via an I2C interface.
+  The Cypress cypd4226 is a dual Type-C controller, and the cypd6129 and
+  cypd6229 are dual Type-C PD controllers. All are controlled via an I2C
+  interface.
 
 properties:
   compatible:
-    const: cypress,cypd4226
+    oneOf:
+      - const: cypress,cypd4226
+      - const: cypress,cypd6129
+      - items:
+          - const: cypress,cypd6229
+          - const: cypress,cypd6129
 
   '#address-cells':
     const: 1
@@ -24,11 +31,10 @@ properties:
     const: 0
 
   reg:
-    const: 0x08
+    maxItems: 1
 
   interrupts:
-    items:
-      - description: cypd4226 host interrupt
+    maxItems: 1
 
   firmware-name:
     enum:
@@ -40,6 +46,19 @@ properties:
       - "nvidia,gpu" for the NVIDIA RTX product series
       - "nvidia,jetson-agx-xavier" for the NVIDIA Jetson product series
 
+  pinctrl-0: true
+  pinctrl-1: true
+
+  pinctrl-names:
+    minItems: 1
+    items:
+      - const: default
+      - const: sleep
+
+  wakeup-source:
+    description: enable IRQ remote wakeup, see power/wakeup-source.txt
+    type: boolean
+
 patternProperties:
   '^connector@[01]$':
     $ref: /schemas/connector/usb-connector.yaml#
@@ -57,6 +76,24 @@ anyOf:
   - required:
       - connector@1
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: cypress,cypd4226
+    then:
+      properties:
+        reg:
+          const: 0x08
+        pinctrl-0: false
+        pinctrl-1: false
+        pinctrl-names: false
+        wakeup-source: false
+    else:
+      properties:
+        firmware-name: false
+
 additionalProperties: false
 
 examples:
@@ -91,3 +128,42 @@ examples:
         };
       };
     };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        typec@40 {
+            compatible = "cypress,cypd6129";
+            reg = <0x40>;
+            interrupts-extended = <&tlmm 136 IRQ_TYPE_LEVEL_LOW>;
+            pinctrl-0 = <&usb0_intr_state>;
+            pinctrl-names = "default";
+            wakeup-source;
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            connector@0 {
+                compatible = "usb-c-connector";
+                reg = <0>;
+                label = "USB-C";
+                data-role = "dual";
+                power-role = "dual";
+
+                ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                        reg = <0>;
+
+                        endpoint {
+                            remote-endpoint = <&usb_role_switch0>;
+                        };
+                    };
+                };
+            };
+        };
+    };
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 8 lines

From: Akash Kumar <[email protected]>

Extend the binding to cover the Cypress cypd6129 and cypd6229 dual Type-C PD controllers, which share the same I2C-controlled interface as the cypd4226. Also add pinctrl and wakeup-source properties, and relax reg/interrupts constraints that only applied to cypd4226.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#4 lore raw

PATCH v3 2/2 usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs

In reply to Akash Kumar

From: Akash Kumar <[email protected]>

Add compatible strings for the Cypress cypd6129 and cypd6229 dual Type-C PD controllers to the of_device_id match table, matching the corresponding dt-bindings update.

---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/typec/ucsi/ucsi_ccg.c +2 -0
index 3f12db95c7f4..34fde72fe0a6 100644
@@ -1556,6 +1556,8 @@ static void ucsi_ccg_remove(struct i2c_client *client)
 
 static const struct of_device_id ucsi_ccg_of_match_table[] = {
 		{ .compatible = "cypress,cypd4226", },
+		{ .compatible = "cypress,cypd6129", },
+		{ .compatible = "cypress,cypd6229", },
 		{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ucsi_ccg_of_match_table);
Signature · 1 line
2.43.0
#5 lore raw

Re: [PATCH v3 2/2] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines

From: Akash Kumar <[email protected]>

Add compatible strings for the Cypress cypd6129 and cypd6229 dual Type-C PD controllers to the of_device_id match table, matching the corresponding dt-bindings update.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2