[PATCH v16 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on one HS data bus
From: Qianhui Xu
Date: Wed Nov 25 2026 - 09:23:36 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 v15
sashiko reviewed v15 1/3 on 2026-11-25 and reported two low-severity binding
issues, "[Low] dt-bindings: usb: snps,dwc3: incomplete endpoint schema under
port@0" and "[Low] dt-bindings: usb: snps,dwc3: inter-version changelog above
tearline". Both are accepted; this patch is the only one that changed.
1) Endpoint schema under "port@0". Accepted. "port@0" is described through
the graph "$defs/port-base", which leaves "unevaluatedProperties" open on
purpose, so a plain "endpoint" of a single-connector controller accepted
"usb-role-switch" and "mux-state" without any schema recording what they
mean there. The "else" branch now puts the generic graph port binding on
"port@0"; its endpoint schema has "unevaluatedProperties: false", so an
endpoint of a controller without a mux cannot carry either property.
2) Unit address pattern in the "mux-controls" branch. Accepted. The pattern
that rejects a third endpoint read '^endpoint@([2-9]|[1-9a-f][0-9a-f]+)$',
which let 'endpoint@a' through ('endpoint@a' to 'endpoint@f' are accepted
unit addresses in graph.yaml). It now reads
'^endpoint@([2-9a-f]|[0-9a-f]{2,})$', the exact complement of
'endpoint@0'/'endpoint@1' among the addresses graph.yaml accepts, so
'endpoint@a' and multi-digit addresses such as 'endpoint@10' are rejected
as well.
3) Revision log position. Accepted. The "Changes since v13" log of v15 was
in the commit message; it is below the "---" tearline of this patch now,
together with the log above.
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