Devicetree
 help / color / mirror / Atom feed
* [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO
@ 2026-11-24  8:53 Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support Akash Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Akash Kumar @ 2026-11-24  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wayne Chang, Heikki Krogerus
  Cc: linux-usb, devicetree, linux-kernel, Akash Kumar, Akash Kumar,
	Conor Dooley, Abel Vesa

This series adds support for the Cypress cypd6129/cypd6229 dual
Type-C PD controllers (same I2C-controlled interface as cypd4226) to
the dt-bindings and ucsi_ccg driver, plus an optional
orientation-gpios property so boards without an HPI CC-polarity
register can still report Type-C connector orientation to the typec
class through typec_set_orientation().

Patches 1-2 (cypd6129/cypd6229 support) were previously reviewed and
carried as a standalone dependency for this series; folding them in
here so the whole stack goes out together.

Patch 1 extends the cypd4226 binding to cover cypd6129/cypd6229.

Patch 2 adds the corresponding of_device_id entries in ucsi_ccg.

Patch 3 documents the new orientation-gpios property on
cypress,cypd4226.yaml, ordered by connector number (an entry may be
left as <0> for connectors with no sense line).

Patch 4 wires it up in ucsi_ccg: acquire an optional GPIO per
connector in probe(), indexed by the connector's reg property, and
use it from new update_connector/connector_status UCSI ops to set
typec_cap.orientation_aware and drive typec_set_orientation().

To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Wayne Chang <waynec@nvidia.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Akash Kumar <akash.kumar@oss.qualcomm.com>

Changes in v3:
- Folded the previously-separate cypd6129/cypd6229 dt-bindings and
  ucsi_ccg of_device_id patches into this series (now 4 patches
  instead of 2), so the whole stack is reviewed and merged together.
- Fixed the orientation-gpios example in cypress,cypd4226.yaml: the
  GPIO specifier used a literal placeholder pin number ("XX")
  instead of a real pin number, which broke 'make dt_binding_check'
  (dtc lexer error parsing the example dts).
- Link to v2: https://lore.kernel.org/r/20261117-ucsi-ccg-cc-orientation-v2-0-2e3576a11eb7@qti.qualcomm.com

Changes in v2:
- Correct sender/author identity to akash.kumar@oss.qualcomm.com
  (no functional changes)
- Link to v1: https://lore.kernel.org/r/20261117-ucsi-ccg-cc-orientation-v1-0-a0fb052c7fcd@qti.qualcomm.com

---
Akash Kumar (4):
      dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support
      usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs
      dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property
      usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO

---
Akash Kumar (4):
      dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support
      usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs
      dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property
      usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO

 .../devicetree/bindings/usb/cypress,cypd4226.yaml  | 100 +++++++++++++++++++--
 drivers/usb/typec/ucsi/ucsi_ccg.c                  |  79 +++++++++++++++-
 2 files changed, 171 insertions(+), 8 deletions(-)
---
base-commit: 8e31dedb9ad496ea7dd7064d77d6f7d459c1c90f
change-id: 20261117-ucsi-ccg-cc-orientation-cd3e221ed635

Best regards,
-- 
Akash Kumar <akash.kumar@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support
  2026-11-24  8:53 [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO Akash Kumar
@ 2026-11-24  8:53 ` Akash Kumar
  2026-11-24  9:02   ` sashiko-bot
  2026-11-24  8:53 ` [PATCH v3 2/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs Akash Kumar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Akash Kumar @ 2026-11-24  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wayne Chang, Heikki Krogerus
  Cc: linux-usb, devicetree, linux-kernel, Akash Kumar, Akash Kumar,
	Conor Dooley

From: Akash Kumar <akakum@qti.qualcomm.com>

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.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
---
 .../devicetree/bindings/usb/cypress,cypd4226.yaml  | 90 ++++++++++++++++++++--
 1 file changed, 83 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
index 0620d82508c1..d923ef82ecfa 100644
--- a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
+++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
@@ -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 <waynec@nvidia.com>
+  - Akash Kumar <akash.kumar@oss.qualcomm.com>
 
 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>;
+                        };
+                    };
+                };
+            };
+        };
+    };

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs
  2026-11-24  8:53 [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support Akash Kumar
@ 2026-11-24  8:53 ` Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 3/4] dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
  3 siblings, 0 replies; 7+ messages in thread
From: Akash Kumar @ 2026-11-24  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wayne Chang, Heikki Krogerus
  Cc: linux-usb, devicetree, linux-kernel, Akash Kumar, Akash Kumar,
	Abel Vesa

From: Akash Kumar <akakum@qti.qualcomm.com>

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.

Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 96d0557a862d..c560d4539302 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -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);

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/4] dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property
  2026-11-24  8:53 [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 2/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs Akash Kumar
@ 2026-11-24  8:53 ` Akash Kumar
  2026-11-24  8:53 ` [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
  3 siblings, 0 replies; 7+ messages in thread
From: Akash Kumar @ 2026-11-24  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wayne Chang, Heikki Krogerus
  Cc: linux-usb, devicetree, linux-kernel, Akash Kumar

Add the optional orientation-gpios property, used to sense the CC
orientation of each Type-C connector on boards where the CCGx chip
has no HPI register exposing CC polarity. Entries are ordered by
connector number; an entry may be left as <0> for connectors with no
sense line.

Signed-off-by: Akash Kumar <akash.kumar@oss.qualcomm.com>
---
 Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
index d923ef82ecfa..298afd2542d0 100644
--- a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
+++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
@@ -59,6 +59,14 @@ properties:
     description: enable IRQ remote wakeup, see power/wakeup-source.txt
     type: boolean
 
+  orientation-gpios:
+    description:
+      GPIOs used to sense the CC orientation of each Type-C connector.
+      Entries are ordered by connector number, i.e. the first entry
+      corresponds to connector@0 and the second to connector@1.
+    minItems: 1
+    maxItems: 2
+
 patternProperties:
   '^connector@[01]$':
     $ref: /schemas/connector/usb-connector.yaml#
@@ -129,6 +137,7 @@ examples:
       };
     };
   - |
+    #include <dt-bindings/gpio/gpio.h>
     #include <dt-bindings/interrupt-controller/irq.h>
     i2c {
         #address-cells = <1>;
@@ -141,6 +150,7 @@ examples:
             pinctrl-0 = <&usb0_intr_state>;
             pinctrl-names = "default";
             wakeup-source;
+            orientation-gpios = <0>, <&tlmm 137 GPIO_ACTIVE_HIGH>;
 
             #address-cells = <1>;
             #size-cells = <0>;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO
  2026-11-24  8:53 [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO Akash Kumar
                   ` (2 preceding siblings ...)
  2026-11-24  8:53 ` [PATCH v3 3/4] dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property Akash Kumar
@ 2026-11-24  8:53 ` Akash Kumar
  2026-11-24  9:06   ` sashiko-bot
  3 siblings, 1 reply; 7+ messages in thread
From: Akash Kumar @ 2026-11-24  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wayne Chang, Heikki Krogerus
  Cc: linux-usb, devicetree, linux-kernel, Akash Kumar

The CCGx chip has no HPI register exposing CC polarity, so there is
no way for the driver to report typec_cap.orientation_aware or call
typec_set_orientation() from UCSI status alone. On boards that wire
a sense line to the connector, pick it up via the orientation-gpios
property and use it to report orientation.

Acquire an optional "orientation" GPIO for each connector child node
in ucsi_ccg_probe(), indexed by the connector's reg property. Add
update_connector and connector_status ops that mark the connector
orientation_aware when a GPIO is present, and drive
typec_set_orientation() from the GPIO value while connected.

Signed-off-by: Akash Kumar <akash.kumar@oss.qualcomm.com>
---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 77 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 76 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index c560d4539302..06c536d87694 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -10,6 +10,7 @@
 #include <linux/acpi.h>
 #include <linux/delay.h>
 #include <linux/firmware.h>
+#include <linux/gpio/consumer.h>
 #include <linux/hex.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
@@ -17,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 #include <linux/usb/typec_dp.h>
 
 #include <linux/unaligned.h>
@@ -201,6 +203,9 @@ struct op_region {
 	__le32 message_in[CCGX_MESSAGE_IN_MAX];
 };
 
+/* CCGx can expose at most 2 PD ports per chip */
+#define CCG_MAX_PORTS 2
+
 struct ucsi_ccg {
 	struct device *dev;
 	struct ucsi *ucsi;
@@ -235,6 +240,15 @@ struct ucsi_ccg {
 	 */
 	spinlock_t op_lock;
 	struct op_region op_data;
+
+	/*
+	 * Optional per-connector CC-orientation GPIO ("orientation-gpios"
+	 * on the controller node). Not part of the UCSI spec's connector
+	 * status - the CCGx chip has no HPI register exposing CC polarity,
+	 * so orientation must come from a board-level sense line if one
+	 * exists. Left NULL (orientation_aware stays false) when absent.
+	 */
+	struct gpio_desc *orientation_gpio[CCG_MAX_PORTS];
 };
 
 static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
@@ -694,6 +708,37 @@ static int ucsi_ccg_sync_control(struct ucsi *ucsi, u64 command, u32 *cci,
 	return ret;
 }
 
+static void ucsi_ccg_update_connector(struct ucsi_connector *con)
+{
+	struct ucsi_ccg *uc = ucsi_get_drvdata(con->ucsi);
+
+	if (con->num > CCG_MAX_PORTS || !uc->orientation_gpio[con->num - 1])
+		return;
+
+	con->typec_cap.orientation_aware = true;
+}
+
+static void ucsi_ccg_connector_status(struct ucsi_connector *con)
+{
+	struct ucsi_ccg *uc = ucsi_get_drvdata(con->ucsi);
+	int orientation;
+
+	if (!UCSI_CONSTAT(con, CONNECTED)) {
+		typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);
+		return;
+	}
+
+	if (con->num > CCG_MAX_PORTS || !uc->orientation_gpio[con->num - 1])
+		return;
+
+	orientation = gpiod_get_value_cansleep(uc->orientation_gpio[con->num - 1]);
+	if (orientation < 0)
+		return;
+
+	typec_set_orientation(con->port, orientation ? TYPEC_ORIENTATION_REVERSE :
+							TYPEC_ORIENTATION_NORMAL);
+}
+
 static const struct ucsi_operations ucsi_ccg_ops = {
 	.read_version = ucsi_ccg_read_version,
 	.read_cci = ucsi_ccg_read_cci,
@@ -701,7 +746,9 @@ static const struct ucsi_operations ucsi_ccg_ops = {
 	.read_message_in = ucsi_ccg_read_message_in,
 	.sync_control = ucsi_ccg_sync_control,
 	.async_control = ucsi_ccg_async_control,
-	.update_altmodes = ucsi_ccg_update_altmodes
+	.update_altmodes = ucsi_ccg_update_altmodes,
+	.update_connector = ucsi_ccg_update_connector,
+	.connector_status = ucsi_ccg_connector_status,
 };
 
 static irqreturn_t ccg_irq_handler(int irq, void *data)
@@ -1506,6 +1553,34 @@ static int ucsi_ccg_probe(struct i2c_client *client)
 	if (uc->info.mode & CCG_DEVINFO_PDPORTS_MASK)
 		uc->port_num++;
 
+	device_for_each_child_node_scoped(dev, fwnode) {
+		struct gpio_desc *desc;
+		u32 port;
+
+		status = fwnode_property_read_u32(fwnode, "reg", &port);
+		if (status < 0) {
+			dev_err(dev, "missing reg property of %pOFn\n", fwnode);
+			return status;
+		}
+
+		if (port >= CCG_MAX_PORTS) {
+			dev_warn(dev, "invalid connector number, ignoring\n");
+			continue;
+		}
+
+		desc = devm_gpiod_get_index_optional(dev, "orientation", port, GPIOD_IN);
+
+		/* If GPIO isn't found, continue */
+		if (!desc)
+			continue;
+
+		if (IS_ERR(desc))
+			return dev_err_probe(dev, PTR_ERR(desc),
+					      "unable to acquire orientation gpio\n");
+
+		uc->orientation_gpio[port] = desc;
+	}
+
 	uc->ucsi = ucsi_create(dev, &ucsi_ccg_ops);
 	if (IS_ERR(uc->ucsi))
 		return PTR_ERR(uc->ucsi);

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support
  2026-11-24  8:53 ` [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support Akash Kumar
@ 2026-11-24  9:02   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-24  9:02 UTC (permalink / raw)
  To: Akash Kumar; +Cc: linux-usb, devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dt-bindings: usb: cypress,cypd4226: forbidding pinctrl breaks
  dtbs_check
--

commit 11119299ad04fdbd9d099cb405886c5e195a210d
Author: Akash Kumar <akakum@qti.qualcomm.com>

dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support

This commit extends the cypress,cypd4226 device tree binding to support
the cypd6129 and cypd6229 dual Type-C PD controllers, adds pinctrl and
wakeup-source properties, and relaxes reg and interrupts constraints.

> diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> index 0620d82508c17..d923ef82ecfaa 100644
> --- a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> +++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml

[ ... ]

> @@ -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

[Severity: Medium]
Does setting pinctrl-0, pinctrl-1, pinctrl-names, and wakeup-source to
false for cypress,cypd4226 cause a dtbs_check regression on existing
boards?

pinctrl-0 through pinctrl-8 and pinctrl-names are standard pin-controller
consumer properties already allowed on all device nodes by the dtschema
core without needing to be declared in individual bindings, and
wakeup-source is a board-level host interrupt property applicable to any
of these controllers.  In particular, an existing in-tree cypress,cypd4226
node uses pinctrl-0 and pinctrl-names for its host interrupt GPIO and will
now fail schema validation:

arch/arm64/boot/dts/qcom/monaco-arduino-monza.dts {
    ...
	typec@8 {
		compatible = "cypress,cypd4226";
		reg = <0x08>;
		pinctrl-0 = <&typec_default_state>;
		pinctrl-names = "default";
		interrupts-extended = <&tlmm 3 IRQ_TYPE_LEVEL_LOW>;
    ...
}

Dropping the top-level pinctrl-* declarations and removing pinctrl-0,
pinctrl-1, pinctrl-names, and wakeup-source from the cypress,cypd4226
if/then block would avoid this failure.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-ucsi-ccg-cc-orientation-v3-0-73cd114e5393@oss.qualcomm.com?part=1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO
  2026-11-24  8:53 ` [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
@ 2026-11-24  9:06   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-24  9:06 UTC (permalink / raw)
  To: Akash Kumar; +Cc: linux-usb, devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] usb: typec: ucsi_ccg: wrong %pOFn format for fwnode in
  ucsi_ccg_probe()
--

commit 4f8b454feccd38f23c3b043c36a16ff7ae4ab46d
Author: Akash Kumar <akash.kumar@oss.qualcomm.com>

usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO

This commit adds optional per-connector GPIO sensing to report USB Type-C
CC orientation on Cypress CCGx controllers via the orientation-gpios
property.

> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index c560d45393024..06c536d876940 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c

[ ... ]

> @@ -1506,6 +1553,34 @@ static int ucsi_ccg_probe(struct i2c_client *client)
>  	if (uc->info.mode & CCG_DEVINFO_PDPORTS_MASK)
>  		uc->port_num++;
>  
> +	device_for_each_child_node_scoped(dev, fwnode) {
> +		struct gpio_desc *desc;
> +		u32 port;
> +
> +		status = fwnode_property_read_u32(fwnode, "reg", &port);
> +		if (status < 0) {
> +			dev_err(dev, "missing reg property of %pOFn\n", fwnode);
> +			return status;
> +		}

[Severity: Medium]
Should this format specifier be %pfwP instead of %pOFn?

device_for_each_child_node_scoped() yields a struct fwnode_handle *,
whereas %pOFn expects a struct device_node * and applies
of_fwnode_handle(dn) (&dn->fwnode) in device_node_string(), causing an
invalid or NULL pointer dereference if a child node is missing its reg
property.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-ucsi-ccg-cc-orientation-v3-0-73cd114e5393@oss.qualcomm.com?part=4

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-24  9:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24  8:53 [PATCH v3 0/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 support and CC orientation sensing via GPIO Akash Kumar
2026-11-24  8:53 ` [PATCH v3 1/4] dt-bindings: usb: cypress,cypd4226: Add cypd6129/cypd6229 support Akash Kumar
2026-11-24  9:02   ` sashiko-bot
2026-11-24  8:53 ` [PATCH v3 2/4] usb: typec: ucsi_ccg: Add cypd6129/cypd6229 OF device IDs Akash Kumar
2026-11-24  8:53 ` [PATCH v3 3/4] dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property Akash Kumar
2026-11-24  8:53 ` [PATCH v3 4/4] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
2026-11-24  9:06   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox