[PATCH v17 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on one HS data bus
From: Qianhui Xu
Date: Sun Nov 29 2026 - 20:26:53 EST
Some designs route two USB Type-C receptacles through one High Speed
D+/D- pair with a GPIO multiplexer, so only one connector drives the
controller at a time and the device tree has to say which role-switch
input and which mux state belongs to each of them.
A mux'ed data stream on one bus is an endpoint of that port in the OF
graph, not a port of its own, so the two connectors become endpoint@0
and endpoint@1 of the High Speed port, next to the Super Speed port@1.
Each endpoint carries "usb-role-switch" and the "mux-state" that
reaches it, and the multiplexer is referenced with "mux-controls", so
an existing "gpio-mux" controller is used as is instead of a private
property.
The High Speed port definition stays optional: a single-connector
controller keeps describing one plain "endpoint", the two endpoints
are required only when "mux-controls" is present, and the two states
must be opposite so that the two connectors cannot both claim the same
data path.
Signed-off-by: Qianhui Xu <xiaqinghuan@xxxxxxxxxxxxxxxx>
---
.../bindings/usb/snps,dwc3-common.yaml | 106 +++++++++++++++++-
1 file changed, 105 insertions(+), 1 deletion(-)
Changes since v16
Rebase only, onto v7.4-rc5 (fe6ff8d5d675). The window reworked the dwc3
gadget side (Thinh Nguyen's End Transfer series) and the dwc3-qcom glue,
but did not touch this binding: snps,dwc3-common.yaml of v7.4-rc5 is
byte-identical to the v7.4-rc3 base of v16, so the "diff --git" section
is unchanged and applies with no offset and no fuzz. The series is
regenerated as a whole, so the AI-assistance disclosure paragraph that
the v16 cover letter promised back into every patch is below.
*** AI-assistance disclosure ***
This patch was prepared with the help of an LLM coding assistant. The
author reviewed every line, checked every quoted claim against the tree,
and ran the gates quoted in the cover letter; the design decisions and
any errors are the author's.
diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
index 6c0b8b653824..1f23840fd1f2 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
@@ -26,8 +26,84 @@ allOf:
$ref: usb.yaml#
else:
$ref: usb-xhci.yaml#
+ - if:
+ required: [mux-controls]
+ then:
+ # A multiplexed High Speed bus only makes sense when the controller is
+ # dual-role and both connectors can switch their role independently.
+ required: [ports, usb-role-switch]
+ properties:
+ dr_mode:
+ const: otg
+ ports:
+ required: [port@0]
+ properties:
+ port@0:
+ required: ['#address-cells', '#size-cells',
+ endpoint@0, endpoint@1]
+ # A mux'ed High Speed bus has exactly two connectors, as the
+ # two endpoints of this port; a plain "endpoint" or any further
+ # endpoint would be a third data stream and is not described.
+ properties:
+ endpoint: false
+ patternProperties:
+ '^endpoint@[01]$':
+ required: [usb-role-switch, mux-state]
+ '^endpoint@([2-9a-f]|[0-9a-f]{2,})$': false
+ # The two connectors must claim opposite mux states. Kept inside
+ # this branch: JSON Schema evaluates "properties" of an absent
+ # property as true, so the same "oneOf" outside the branch would
+ # see both alternatives match when "mux-state" is not used at all.
+ oneOf:
+ - properties:
+ endpoint@0:
+ properties:
+ mux-state:
+ const: 0
+ endpoint@1:
+ properties:
+ mux-state:
+ const: 1
+ - properties:
+ endpoint@0:
+ properties:
+ mux-state:
+ const: 1
+ endpoint@1:
+ properties:
+ mux-state:
+ const: 0
+ else:
+ # Without a mux the High Speed port keeps the generic graph port
+ # binding, so single-connector controllers are described as before and
+ # the per-connector properties have no meaning.
+ properties:
+ ports:
+ properties:
+ port@0:
+ # "port-base" leaves "unevaluatedProperties" open on a plain
+ # "endpoint" child, so without a mux the generic graph port
+ # binding is used here: its endpoint schema rejects
+ # "usb-role-switch" and "mux-state" instead of taking them
+ # silently.
+ $ref: /schemas/graph.yaml#/properties/port
+ patternProperties:
+ '^endpoint@[01]$':
+ properties:
+ usb-role-switch: false
+ mux-state: false
properties:
+ mux-controls:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ maxItems: 1
+ description:
+ Phandle to the multiplexer that selects which of the two connectors
+ drives the controller's shared High Speed data bus, e.g. a
+ "gpio-mux" controller. Each connector is described by the endpoint@0
+ or endpoint@1 of "port@0", and the endpoint of that connector carries
+ its own role-switch input and the "mux-state" it is reached in.
+
extcon:
maxItems: 1
deprecated: true
@@ -411,9 +487,37 @@ properties:
properties:
port@0:
- $ref: /schemas/graph.yaml#/properties/port
+ # The High Speed port carries the controller's HS data stream. Two
+ # receptacles sharing one HS D+/D- pair are two mux'ed data streams of
+ # that one stream, so they are two endpoints of this port and not two
+ # ports. A single-connector controller describes the plain "endpoint"
+ # of the graph binding and is unaffected.
+ $ref: /schemas/graph.yaml#/$defs/port-base
+ unevaluatedProperties: false
description: High Speed (HS) data bus.
+ patternProperties:
+ '^endpoint@[01]$':
+ $ref: /schemas/graph.yaml#/$defs/endpoint-base
+ unevaluatedProperties: false
+
+ properties:
+ usb-role-switch:
+ type: boolean
+ description:
+ This connector has its own USB role switch, registered
+ against this endpoint.
+
+ mux-state:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1]
+ description:
+ State of the High Speed data bus multiplexer which connects
+ this connector to the controller. The two connectors of one
+ controller must use different states.
+
+ required: [reg]
+
port@1:
$ref: /schemas/graph.yaml#/properties/port
description: Super Speed (SS) data bus.
--
2.53.0