Skip to content

Commit 431a30b

Browse files
Prashant Malanirobherring
authored andcommitted
dt-bindings: Convert usb-connector to YAML format.
Convert the usb-connector.txt bindings file to YAML format. This allows it to be used in dt_bindings_check verification. This patch was born out of a patch series for the addition of a Type C connector class port driver[1]. An attempt has been made to maintain the same documentation text and example structure as was in the .txt file, but wherever needed modifications have been made to satisfy dt_bindings_check. Also, update all references to usb-connector.txt to now use usb-connector.yaml. [1]: https://lkml.org/lkml/2020/2/19/1232 Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent e329f87 commit 431a30b

11 files changed

Lines changed: 216 additions & 145 deletions

‎Documentation/devicetree/bindings/connector/samsung,usb-connector-11pin.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Required nodes:
1919
0: High Speed (HS),
2020
3: Mobile High-Definition Link (MHL), specific to 11-pin Samsung micro-USB.
2121

22-
[1]: bindings/connector/usb-connector.txt
22+
[1]: bindings/connector/usb-connector.yaml
2323

2424
Example
2525
-------

‎Documentation/devicetree/bindings/connector/usb-connector.txt‎

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/connector/usb-connector.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: USB Connector
8+
9+
maintainers:
10+
- Rob Herring <robh@kernel.org>
11+
12+
description:
13+
A USB connector node represents a physical USB connector. It should be a child
14+
of a USB interface controller.
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- usb-a-connector
20+
- usb-b-connector
21+
- usb-c-connector
22+
23+
label:
24+
description: Symbolic name for the connector.
25+
26+
type:
27+
description: Size of the connector, should be specified in case of
28+
non-fullsize 'usb-a-connector' or 'usb-b-connector' compatible
29+
connectors.
30+
allOf:
31+
- $ref: /schemas/types.yaml#definitions/string
32+
enum:
33+
- mini
34+
- micro
35+
36+
self-powered:
37+
description: Set this property if the USB device has its own power source.
38+
type: boolean
39+
40+
# The following are optional properties for "usb-b-connector".
41+
id-gpios:
42+
description: An input gpio for USB ID pin.
43+
maxItems: 1
44+
45+
vbus-gpios:
46+
description: An input gpio for USB VBus pin, used to detect presence of
47+
VBUS 5V.
48+
maxItems: 1
49+
50+
vbus-supply:
51+
description: A phandle to the regulator for USB VBUS if needed when host
52+
mode or dual role mode is supported.
53+
Particularly, if use an output GPIO to control a VBUS regulator, should
54+
model it as a regulator. See bindings/regulator/fixed-regulator.yaml
55+
56+
# The following are optional properties for "usb-c-connector".
57+
power-role:
58+
description: Determines the power role that the Type C connector will
59+
support. "dual" refers to Dual Role Port (DRP).
60+
allOf:
61+
- $ref: /schemas/types.yaml#definitions/string
62+
enum:
63+
- source
64+
- sink
65+
- dual
66+
67+
try-power-role:
68+
description: Preferred power role.
69+
allOf:
70+
- $ref: /schemas/types.yaml#definitions/string
71+
enum:
72+
- source
73+
- sink
74+
- dual
75+
76+
data-role:
77+
description: Data role if Type C connector supports USB data. "dual" refers
78+
Dual Role Device (DRD).
79+
allOf:
80+
- $ref: /schemas/types.yaml#definitions/string
81+
enum:
82+
- host
83+
- device
84+
- dual
85+
86+
# The following are optional properties for "usb-c-connector" with power
87+
# delivery support.
88+
source-pdos:
89+
description: An array of u32 with each entry providing supported power
90+
source data object(PDO), the detailed bit definitions of PDO can be found
91+
in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2
92+
Source_Capabilities Message, the order of each entry(PDO) should follow
93+
the PD spec chapter 6.4.1. Required for power source and power dual role.
94+
User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO()
95+
defined in dt-bindings/usb/pd.h.
96+
minItems: 1
97+
maxItems: 7
98+
allOf:
99+
- $ref: /schemas/types.yaml#/definitions/uint32-array
100+
101+
sink-pdos:
102+
description: An array of u32 with each entry providing supported power sink
103+
data object(PDO), the detailed bit definitions of PDO can be found in
104+
"Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
105+
Sink Capabilities Message, the order of each entry(PDO) should follow the
106+
PD spec chapter 6.4.1. Required for power sink and power dual role. User
107+
can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
108+
in dt-bindings/usb/pd.h.
109+
minItems: 1
110+
maxItems: 7
111+
allOf:
112+
- $ref: /schemas/types.yaml#/definitions/uint32-array
113+
114+
op-sink-microwatt:
115+
description: Sink required operating power in microwatt, if source can't
116+
offer the power, Capability Mismatch is set. Required for power sink and
117+
power dual role.
118+
119+
ports:
120+
description: OF graph bindings (specified in bindings/graph.txt) that model
121+
any data bus to the connector unless the bus is between parent node and
122+
the connector. Since a single connector can have multiple data buses every
123+
bus has an assigned OF graph port number as described below.
124+
type: object
125+
properties:
126+
port@0:
127+
type: object
128+
description: High Speed (HS), present in all connectors.
129+
130+
port@1:
131+
type: object
132+
description: Super Speed (SS), present in SS capable connectors.
133+
134+
port@2:
135+
type: object
136+
description: Sideband Use (SBU), present in USB-C. This describes the
137+
alternate mode connection of which SBU is a part.
138+
139+
required:
140+
- port@0
141+
142+
required:
143+
- compatible
144+
145+
examples:
146+
# Micro-USB connector with HS lines routed via controller (MUIC).
147+
- |+
148+
muic-max77843 {
149+
usb_con1: connector {
150+
compatible = "usb-b-connector";
151+
label = "micro-USB";
152+
type = "micro";
153+
};
154+
};
155+
156+
# USB-C connector attached to CC controller (s2mm005), HS lines routed
157+
# to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort.
158+
# DisplayPort video lines are routed to the connector via SS mux in USB3 PHY.
159+
- |+
160+
ccic: s2mm005 {
161+
usb_con2: connector {
162+
compatible = "usb-c-connector";
163+
label = "USB-C";
164+
165+
ports {
166+
#address-cells = <1>;
167+
#size-cells = <0>;
168+
169+
port@0 {
170+
reg = <0>;
171+
usb_con_hs: endpoint {
172+
remote-endpoint = <&max77865_usbc_hs>;
173+
};
174+
};
175+
port@1 {
176+
reg = <1>;
177+
usb_con_ss: endpoint {
178+
remote-endpoint = <&usbdrd_phy_ss>;
179+
};
180+
};
181+
port@2 {
182+
reg = <2>;
183+
usb_con_sbu: endpoint {
184+
remote-endpoint = <&dp_aux>;
185+
};
186+
};
187+
};
188+
};
189+
};
190+
191+
# USB-C connector attached to a typec port controller(ptn5110), which has
192+
# power delivery support and enables drp.
193+
- |+
194+
#include <dt-bindings/usb/pd.h>
195+
typec: ptn5110 {
196+
usb_con3: connector {
197+
compatible = "usb-c-connector";
198+
label = "USB-C";
199+
power-role = "dual";
200+
try-power-role = "sink";
201+
source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
202+
sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
203+
PDO_VAR(5000, 12000, 2000)>;
204+
op-sink-microwatt = <10000000>;
205+
};
206+
};

‎Documentation/devicetree/bindings/usb/fcs,fusb302.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Required sub-node:
99
- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings
1010
of the connector node are specified in:
1111

12-
Documentation/devicetree/bindings/connector/usb-connector.txt
12+
Documentation/devicetree/bindings/connector/usb-connector.yaml
1313

1414

1515
Example:

‎Documentation/devicetree/bindings/usb/generic.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Optional properties:
3434
- usb-role-switch: boolean, indicates that the device is capable of assigning
3535
the USB data role (USB host or USB device) for a given
3636
USB connector, such as Type-C, Type-B(micro).
37-
see connector/usb-connector.txt.
37+
see connector/usb-connector.yaml.
3838

3939
This is an attribute to a USB controller such as:
4040

‎Documentation/devicetree/bindings/usb/mediatek,mtu3.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Optional properties:
3434
dual-role mode.
3535
it's considered valid for compatibility reasons, not allowed for
3636
new bindings, and put into a usb-connector node.
37-
see connector/usb-connector.txt.
37+
see connector/usb-connector.yaml.
3838
- pinctrl-names : a pinctrl state named "default" is optional, and need be
3939
defined if auto drd switch is enabled, that means the property dr_mode
4040
is set as "otg", and meanwhile the property "mediatek,enable-manual-drd"

‎Documentation/devicetree/bindings/usb/mediatek,musb.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Optional properties:
2323
MTCMOS
2424

2525
Required child nodes:
26-
usb connector node as defined in bindings/connector/usb-connector.txt
26+
usb connector node as defined in bindings/connector/usb-connector.yaml
2727
Optional properties:
2828
- id-gpios : input GPIO for USB ID pin.
2929
- vbus-gpios : input GPIO for USB VBUS pin.

‎Documentation/devicetree/bindings/usb/richtek,rt1711h.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Required properties:
99
Required sub-node:
1010
- connector: The "usb-c-connector" attached to the tcpci chip, the bindings
1111
of connector node are specified in
12-
Documentation/devicetree/bindings/connector/usb-connector.txt
12+
Documentation/devicetree/bindings/connector/usb-connector.yaml
1313

1414
Example :
1515
rt1711h@4e {

0 commit comments

Comments
 (0)