summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml
blob: 1745e28b31105252e5b4b79dfe142f370c5d7294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/ti,tps6598x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments 6598x Type-C Port Switch and Power Delivery controller

maintainers:
  - Bryan O'Donoghue <bryan.odonoghue@linaro.org>

description: |
  Texas Instruments 6598x Type-C Port Switch and Power Delivery controller

  A variant of this controller known as Apple CD321x or Apple ACE is also
  present on hardware with Apple SoCs such as the M1.

properties:
  compatible:
    enum:
      - ti,tps6598x
      - apple,cd321x
      - ti,tps25750

  reg:
    minItems: 1
    items:
      - description: main PD controller address
      - description: |
          I2C slave address field in PBMs input data
          which is used as the device address when writing the
          patch for TPS25750.
          The patch address can be any value except 0x00, 0x20,
          0x21, 0x22, and 0x23

  reg-names:
    items:
      - const: main
      - const: patch-address

  reset-gpios:
    description: GPIO used for the HRESET pin.
    maxItems: 1

  wakeup-source: true

  interrupts:
    maxItems: 1

  interrupt-names:
    items:
      - const: irq

  connector:
    $ref: /schemas/connector/usb-connector.yaml#

  firmware-name:
    description: |
      Should contain the name of the default patch binary
      file located on the firmware search path which is
      used to switch the controller into APP mode.
      This is used when tps25750 doesn't have an EEPROM
      connected to it.
    maxItems: 1

required:
  - compatible
  - reg

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: ti,tps25750
    then:
      properties:
        reg:
          maxItems: 2

        connector:
          required:
            - data-role

      required:
        - connector
        - reg-names
    else:
      properties:
        reg:
          maxItems: 1

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        tps6598x: tps6598x@38 {
            compatible = "ti,tps6598x";
            reg = <0x38>;
            wakeup-source;

            interrupt-parent = <&msmgpio>;
            interrupts = <107 IRQ_TYPE_LEVEL_LOW>;
            interrupt-names = "irq";

            pinctrl-names = "default";
            pinctrl-0 = <&typec_pins>;
            reset-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;

            typec_con: connector {
                compatible = "usb-c-connector";
                label = "USB-C";
                port {
                    typec_ep: endpoint {
                        remote-endpoint = <&otg_ep>;
                    };
                };
            };
        };
    };

  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        typec@21 {
            compatible = "ti,tps25750";
            reg = <0x21>, <0x0f>;
            reg-names = "main", "patch-address";

            interrupt-parent = <&msmgpio>;
            interrupts = <100 IRQ_TYPE_LEVEL_LOW>;
            interrupt-names = "irq";
            firmware-name = "tps25750.bin";

            pinctrl-names = "default";
            pinctrl-0 = <&typec_pins>;

            typec_con0: connector {
                compatible = "usb-c-connector";
                label = "USB-C";
                data-role = "dual";
                port {
                    typec_ep0: endpoint {
                        remote-endpoint = <&otg_ep>;
                    };
                };
            };
        };
    };
...