xref: /freebsd/sys/contrib/device-tree/Bindings/usb/gpio-sbu-mux.yaml (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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:
37    description: Flag the port as possible handle of altmode switching
38    type: boolean
39
40  orientation-switch:
41    description: Flag the port as possible handler of orientation switching
42    type: boolean
43
44  port:
45    $ref: /schemas/graph.yaml#/properties/port
46    description:
47      A port node to link the SBU mux to a TypeC controller for the purpose of
48      handling altmode muxing and orientation switching.
49
50required:
51  - compatible
52  - enable-gpios
53  - select-gpios
54  - orientation-switch
55  - port
56
57additionalProperties: false
58
59examples:
60  - |
61    #include <dt-bindings/gpio/gpio.h>
62
63    tcpm {
64        connector {
65            compatible = "usb-c-connector";
66
67            ports {
68                #address-cells = <1>;
69                #size-cells = <0>;
70
71                port@0 {
72                    reg = <0>;
73                    tcpm_hs_out: endpoint {
74                        remote-endpoint = <&usb_hs_phy_in>;
75                    };
76                };
77
78                port@1 {
79                    reg = <1>;
80                    tcpm_ss_out: endpoint {
81                        remote-endpoint = <&usb_ss_phy_in>;
82                    };
83                };
84
85                port@2 {
86                    reg = <2>;
87                    tcpm_sbu_out: endpoint {
88                        remote-endpoint = <&sbu_mux_in>;
89                    };
90                };
91            };
92        };
93    };
94
95    sbu-mux {
96        compatible = "pericom,pi3usb102", "gpio-sbu-mux";
97
98        enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
99        select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
100
101        mode-switch;
102        orientation-switch;
103
104        port {
105            sbu_mux_in: endpoint {
106                remote-endpoint = <&tcpm_sbu_out>;
107            };
108        };
109    };
110...
111