Linux USB
 help / color / mirror / Atom feed
From: Hongyang Zhao <hongyang.zhao@163.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	 Mark Brown <broonie@kernel.org>
Cc: Roger Shimizu <rosh@debian.org>,
	linux-usb@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Hongyang Zhao <hongyang.zhao@163.com>
Subject: [PATCH 1/3] dt-bindings: usb: Add Hynetek HUSB320 Type-C controller
Date: Mon, 20 Jul 2026 16:17:11 +0800	[thread overview]
Message-ID: <20260720-husb320-v1-1-4a1e259d7dc8@163.com> (raw)
In-Reply-To: <20260720-husb320-v1-0-4a1e259d7dc8@163.com>

The HUSB320 is an autonomous USB Type-C Configuration Channel
controller supporting source, sink, and dual-role port operation.

Document its two I2C addresses, active-low interrupt, optional supplies
and enable GPIO, and managed USB-C connector.

Signed-off-by: Hongyang Zhao <hongyang.zhao@163.com>
---
 .../devicetree/bindings/usb/hynetek,husb320.yaml   | 171 +++++++++++++++++++++
 1 file changed, 171 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/hynetek,husb320.yaml b/Documentation/devicetree/bindings/usb/hynetek,husb320.yaml
new file mode 100644
index 000000000000..b84b6b725e84
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/hynetek,husb320.yaml
@@ -0,0 +1,171 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/hynetek,husb320.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hynetek HUSB320 USB Type-C controller
+
+maintainers:
+  - Hongyang Zhao <hongyang.zhao@163.com>
+
+description:
+  The HUSB320 is an autonomous USB Type-C Configuration Channel controller.
+  It supports source, sink and dual-role port configurations, including
+  optional Try.SRC and Try.SNK role preferences. The controller reports cable
+  attachment, orientation, advertised current and accessory detection over
+  I2C and an active-low interrupt.
+
+properties:
+  compatible:
+    const: hynetek,husb320
+
+  reg:
+    description:
+      7-bit I2C address selected by the ADDR/ORIENT pin strap. Ground selects
+      0x21 and VDD selects 0x31. These correspond to the 8-bit write addresses
+      0x42 and 0x62 shown in the datasheet.
+    enum: [0x21, 0x31]
+
+  interrupts:
+    maxItems: 1
+
+  wakeup-source: true
+
+  vdd-supply:
+    description: Power supply for the controller
+
+  enable-gpios:
+    description: Active-low controller enable
+    maxItems: 1
+
+  connector:
+    type: object
+    $ref: /schemas/connector/usb-connector.yaml#
+    unevaluatedProperties: false
+    description:
+      USB Type-C connector managed by the controller. A dual-role data port
+      requires a High-Speed graph connection to a USB role-switch provider.
+
+    properties:
+      compatible:
+        const: usb-c-connector
+
+      try-power-role:
+        enum: [source, sink]
+
+    required:
+      - compatible
+      - pd-disable
+      - power-role
+      - typec-power-opmode
+
+    allOf:
+      - if:
+          properties:
+            power-role:
+              enum: [source, dual]
+        then:
+          required:
+            - vbus-supply
+
+      - if:
+          properties:
+            power-role:
+              const: source
+        then:
+          properties:
+            data-role:
+              const: host
+            try-power-role: false
+
+      - if:
+          properties:
+            power-role:
+              const: sink
+        then:
+          properties:
+            data-role:
+              const: device
+            try-power-role: false
+
+      - if:
+          properties:
+            power-role:
+              const: dual
+        then:
+          properties:
+            data-role:
+              const: dual
+
+      - if:
+          required:
+            - data-role
+          properties:
+            data-role:
+              const: dual
+        then:
+          anyOf:
+            - required:
+                - port
+            - required:
+                - ports
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - connector
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        typec@31 {
+            compatible = "hynetek,husb320";
+            reg = <0x31>;
+            vdd-supply = <&vreg_3v3>;
+            enable-gpios = <&gpio 54 GPIO_ACTIVE_LOW>;
+            interrupts-extended = <&gpio 55 IRQ_TYPE_LEVEL_LOW>;
+            wakeup-source;
+
+            connector {
+                compatible = "usb-c-connector";
+                label = "USB-C";
+                vbus-supply = <&usb_vbus>;
+                data-role = "dual";
+                power-role = "dual";
+                try-power-role = "sink";
+                typec-power-opmode = "default";
+                pd-disable;
+
+                ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                        reg = <0>;
+
+                        endpoint {
+                            remote-endpoint = <&usb_role>;
+                        };
+                    };
+
+                    port@1 {
+                        reg = <1>;
+
+                        endpoint {
+                            remote-endpoint = <&usb_ss>;
+                        };
+                    };
+                };
+            };
+        };
+    };

-- 
2.43.0


  reply	other threads:[~2026-07-20  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  8:17 [PATCH 0/3] Add Hynetek HUSB320 Type-C controller support Hongyang Zhao
2026-07-20  8:17 ` Hongyang Zhao [this message]
2026-07-20  8:17 ` [PATCH 2/3] usb: typec: Add Hynetek HUSB320 Type-C controller driver Hongyang Zhao
2026-07-20  8:17 ` [PATCH 3/3] MAINTAINERS: Add HUSB320 Type-C controller entry Hongyang Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260720-husb320-v1-1-4a1e259d7dc8@163.com \
    --to=hongyang.zhao@163.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rosh@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox