1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/usb/ti,tps6598x.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Texas Instruments 6598x Type-C Port Switch and Power Delivery controller
8
9maintainers:
10  - Bryan O'Donoghue <bryan.odonoghue@linaro.org>
11
12description: |
13  Texas Instruments 6598x Type-C Port Switch and Power Delivery controller
14
15  A variant of this controller known as Apple CD321x or Apple ACE is also
16  present on hardware with Apple SoCs such as the M1.
17
18properties:
19  compatible:
20    enum:
21      - ti,tps6598x
22      - apple,cd321x
23      - ti,tps25750
24
25  reg:
26    minItems: 1
27    items:
28      - description: main PD controller address
29      - description: |
30          I2C slave address field in PBMs input data
31          which is used as the device address when writing the
32          patch for TPS25750.
33          The patch address can be any value except 0x00, 0x20,
34          0x21, 0x22, and 0x23
35
36  reg-names:
37    items:
38      - const: main
39      - const: patch-address
40
41  reset-gpios:
42    description: GPIO used for the HRESET pin.
43    maxItems: 1
44
45  wakeup-source: true
46
47  interrupts:
48    maxItems: 1
49
50  interrupt-names:
51    items:
52      - const: irq
53
54  connector:
55    $ref: /schemas/connector/usb-connector.yaml#
56
57  firmware-name:
58    description: |
59      Should contain the name of the default patch binary
60      file located on the firmware search path which is
61      used to switch the controller into APP mode.
62      This is used when tps25750 doesn't have an EEPROM
63      connected to it.
64    maxItems: 1
65
66required:
67  - compatible
68  - reg
69
70allOf:
71  - if:
72      properties:
73        compatible:
74          contains:
75            const: ti,tps25750
76    then:
77      properties:
78        reg:
79          maxItems: 2
80
81        connector:
82          required:
83            - data-role
84
85      required:
86        - connector
87        - reg-names
88    else:
89      properties:
90        reg:
91          maxItems: 1
92
93additionalProperties: false
94
95examples:
96  - |
97    #include <dt-bindings/gpio/gpio.h>
98    #include <dt-bindings/interrupt-controller/irq.h>
99    i2c {
100        #address-cells = <1>;
101        #size-cells = <0>;
102
103        tps6598x: tps6598x@38 {
104            compatible = "ti,tps6598x";
105            reg = <0x38>;
106            wakeup-source;
107
108            interrupt-parent = <&msmgpio>;
109            interrupts = <107 IRQ_TYPE_LEVEL_LOW>;
110            interrupt-names = "irq";
111
112            pinctrl-names = "default";
113            pinctrl-0 = <&typec_pins>;
114            reset-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
115
116            typec_con: connector {
117                compatible = "usb-c-connector";
118                label = "USB-C";
119                port {
120                    typec_ep: endpoint {
121                        remote-endpoint = <&otg_ep>;
122                    };
123                };
124            };
125        };
126    };
127
128  - |
129    #include <dt-bindings/interrupt-controller/irq.h>
130    i2c {
131        #address-cells = <1>;
132        #size-cells = <0>;
133
134        typec@21 {
135            compatible = "ti,tps25750";
136            reg = <0x21>, <0x0f>;
137            reg-names = "main", "patch-address";
138
139            interrupt-parent = <&msmgpio>;
140            interrupts = <100 IRQ_TYPE_LEVEL_LOW>;
141            interrupt-names = "irq";
142            firmware-name = "tps25750.bin";
143
144            pinctrl-names = "default";
145            pinctrl-0 = <&typec_pins>;
146
147            typec_con0: connector {
148                compatible = "usb-c-connector";
149                label = "USB-C";
150                data-role = "dual";
151                port {
152                    typec_ep0: endpoint {
153                        remote-endpoint = <&otg_ep>;
154                    };
155                };
156            };
157        };
158    };
159...
160