Skip to content

Commit 8f8986e

Browse files
thierryredingrobherring
authored andcommitted
dt-bindings: Merge gpio-usb-b-connector with usb-connector
The binding for usb-connector is a superset of gpio-usb-b-connector. One major difference is that gpio-usb-b-connector requires at least one of the vbus-gpios and id-gpios properties to be specified. Merge the two bindings by adding the compatible string combination for the GPIO USB-B variant and an extra conditional for the required properties list to the usb-connector.yaml file. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 41a0538 commit 8f8986e

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

Documentation/devicetree/bindings/connector/usb-connector.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ description:
1515

1616
properties:
1717
compatible:
18-
enum:
19-
- usb-a-connector
20-
- usb-b-connector
21-
- usb-c-connector
18+
oneOf:
19+
- enum:
20+
- usb-a-connector
21+
- usb-b-connector
22+
- usb-c-connector
23+
24+
- items:
25+
- const: gpio-usb-b-connector
26+
- const: usb-b-connector
2227

2328
label:
2429
description: Symbolic name for the connector.
@@ -140,6 +145,19 @@ properties:
140145
required:
141146
- compatible
142147

148+
allOf:
149+
- if:
150+
properties:
151+
compatible:
152+
contains:
153+
const: gpio-usb-b-connector
154+
then:
155+
anyOf:
156+
- required:
157+
- vbus-gpios
158+
- required:
159+
- id-gpios
160+
143161
examples:
144162
# Micro-USB connector with HS lines routed via controller (MUIC).
145163
- |
@@ -202,3 +220,16 @@ examples:
202220
op-sink-microwatt = <10000000>;
203221
};
204222
};
223+
224+
# USB connector with GPIO control lines
225+
- |
226+
#include <dt-bindings/gpio/gpio.h>
227+
228+
usb {
229+
connector {
230+
compatible = "gpio-usb-b-connector", "usb-b-connector";
231+
type = "micro";
232+
id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
233+
vbus-supply = <&usb_p0_vbus>;
234+
};
235+
};

Documentation/devicetree/bindings/usb/usb-conn-gpio.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)