xref: /linux/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml (revision 5315052d3c6fa7d2d6a8795276bf89c8c2a6f600)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: GPIO-based SBU mux
8
9maintainers:
10  - Bjorn Andersson <andersson@kernel.org>
11
12description:
13  In USB Type-C applications the SBU lines needs to be connected, disconnected
14  and swapped depending on the altmode and orientation. This binding describes
15  a family of hardware solutions which switches between these modes using GPIO
16  signals.
17
18properties:
19  compatible:
20    items:
21      - enum:
22          - nxp,cbdtu02043
23          - onnn,fsusb43l10x
24          - pericom,pi3usb102
25      - const: gpio-sbu-mux
26
27  enable-gpios:
28    description: Switch enable GPIO
29
30  select-gpios:
31    description: Orientation select
32
33  vcc-supply:
34    description: power supply
35
36  mode-switch: true
37  orientation-switch: true
38
39  port:
40    $ref: /schemas/graph.yaml#/properties/port
41    description:
42      A port node to link the SBU mux to a TypeC controller for the purpose of
43      handling altmode muxing and orientation switching.
44
45required:
46  - compatible
47  - select-gpios
48  - orientation-switch
49  - port
50
51allOf:
52  - $ref: usb-switch.yaml#
53  - if:
54      required:
55        - mode-switch
56    then:
57      required:
58        - enable-gpios
59
60additionalProperties: false
61
62examples:
63  - |
64    #include <dt-bindings/gpio/gpio.h>
65
66    tcpm {
67        connector {
68            compatible = "usb-c-connector";
69
70            ports {
71                #address-cells = <1>;
72                #size-cells = <0>;
73
74                port@0 {
75                    reg = <0>;
76                    tcpm_hs_out: endpoint {
77                        remote-endpoint = <&usb_hs_phy_in>;
78                    };
79                };
80
81                port@1 {
82                    reg = <1>;
83                    tcpm_ss_out: endpoint {
84                        remote-endpoint = <&usb_ss_phy_in>;
85                    };
86                };
87
88                port@2 {
89                    reg = <2>;
90                    tcpm_sbu_out: endpoint {
91                        remote-endpoint = <&sbu_mux_in>;
92                    };
93                };
94            };
95        };
96    };
97
98    sbu-mux {
99        compatible = "pericom,pi3usb102", "gpio-sbu-mux";
100
101        enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
102        select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
103
104        mode-switch;
105        orientation-switch;
106
107        port {
108            sbu_mux_in: endpoint {
109                remote-endpoint = <&tcpm_sbu_out>;
110            };
111        };
112    };
113...
114