xref: /freebsd/sys/contrib/device-tree/Bindings/usb/ti,tps6598x.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/usb/ti,tps6598x.yaml#
5fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Texas Instruments 6598x Type-C Port Switch and Power Delivery controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Bryan O'Donoghue <bryan.odonoghue@linaro.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |
13c66ec88fSEmmanuel Vadot  Texas Instruments 6598x Type-C Port Switch and Power Delivery controller
14c66ec88fSEmmanuel Vadot
158cc087a1SEmmanuel Vadot  A variant of this controller known as Apple CD321x or Apple ACE is also
168cc087a1SEmmanuel Vadot  present on hardware with Apple SoCs such as the M1.
178cc087a1SEmmanuel Vadot
18c66ec88fSEmmanuel Vadotproperties:
19c66ec88fSEmmanuel Vadot  compatible:
20c66ec88fSEmmanuel Vadot    enum:
21c66ec88fSEmmanuel Vadot      - ti,tps6598x
228cc087a1SEmmanuel Vadot      - apple,cd321x
2384943d6fSEmmanuel Vadot      - ti,tps25750
2484943d6fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot  reg:
2684943d6fSEmmanuel Vadot    minItems: 1
2784943d6fSEmmanuel Vadot    items:
2884943d6fSEmmanuel Vadot      - description: main PD controller address
2984943d6fSEmmanuel Vadot      - description: |
3084943d6fSEmmanuel Vadot          I2C slave address field in PBMs input data
3184943d6fSEmmanuel Vadot          which is used as the device address when writing the
3284943d6fSEmmanuel Vadot          patch for TPS25750.
3384943d6fSEmmanuel Vadot          The patch address can be any value except 0x00, 0x20,
3484943d6fSEmmanuel Vadot          0x21, 0x22, and 0x23
3584943d6fSEmmanuel Vadot
3684943d6fSEmmanuel Vadot  reg-names:
3784943d6fSEmmanuel Vadot    items:
3884943d6fSEmmanuel Vadot      - const: main
3984943d6fSEmmanuel Vadot      - const: patch-address
40c66ec88fSEmmanuel Vadot
41*8d13bc63SEmmanuel Vadot  reset-gpios:
42*8d13bc63SEmmanuel Vadot    description: GPIO used for the HRESET pin.
43*8d13bc63SEmmanuel Vadot    maxItems: 1
44*8d13bc63SEmmanuel Vadot
45cb7aa33aSEmmanuel Vadot  wakeup-source: true
46cb7aa33aSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  interrupts:
48c66ec88fSEmmanuel Vadot    maxItems: 1
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  interrupt-names:
51c66ec88fSEmmanuel Vadot    items:
52c66ec88fSEmmanuel Vadot      - const: irq
53c66ec88fSEmmanuel Vadot
5484943d6fSEmmanuel Vadot  connector:
5584943d6fSEmmanuel Vadot    $ref: /schemas/connector/usb-connector.yaml#
5684943d6fSEmmanuel Vadot
5784943d6fSEmmanuel Vadot  firmware-name:
5884943d6fSEmmanuel Vadot    description: |
5984943d6fSEmmanuel Vadot      Should contain the name of the default patch binary
6084943d6fSEmmanuel Vadot      file located on the firmware search path which is
6184943d6fSEmmanuel Vadot      used to switch the controller into APP mode.
6284943d6fSEmmanuel Vadot      This is used when tps25750 doesn't have an EEPROM
6384943d6fSEmmanuel Vadot      connected to it.
6484943d6fSEmmanuel Vadot    maxItems: 1
6584943d6fSEmmanuel Vadot
66c66ec88fSEmmanuel Vadotrequired:
67c66ec88fSEmmanuel Vadot  - compatible
68c66ec88fSEmmanuel Vadot  - reg
69c66ec88fSEmmanuel Vadot
7084943d6fSEmmanuel VadotallOf:
7184943d6fSEmmanuel Vadot  - if:
7284943d6fSEmmanuel Vadot      properties:
7384943d6fSEmmanuel Vadot        compatible:
7484943d6fSEmmanuel Vadot          contains:
7584943d6fSEmmanuel Vadot            const: ti,tps25750
7684943d6fSEmmanuel Vadot    then:
7784943d6fSEmmanuel Vadot      properties:
7884943d6fSEmmanuel Vadot        reg:
7984943d6fSEmmanuel Vadot          maxItems: 2
8084943d6fSEmmanuel Vadot
8184943d6fSEmmanuel Vadot        connector:
8284943d6fSEmmanuel Vadot          required:
8384943d6fSEmmanuel Vadot            - data-role
8484943d6fSEmmanuel Vadot
8584943d6fSEmmanuel Vadot      required:
8684943d6fSEmmanuel Vadot        - connector
8784943d6fSEmmanuel Vadot        - reg-names
8884943d6fSEmmanuel Vadot    else:
8984943d6fSEmmanuel Vadot      properties:
9084943d6fSEmmanuel Vadot        reg:
9184943d6fSEmmanuel Vadot          maxItems: 1
9284943d6fSEmmanuel Vadot
9384943d6fSEmmanuel VadotadditionalProperties: false
946be33864SEmmanuel Vadot
95c66ec88fSEmmanuel Vadotexamples:
96c66ec88fSEmmanuel Vadot  - |
97*8d13bc63SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
98c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
99fac71e4eSEmmanuel Vadot    i2c {
100c66ec88fSEmmanuel Vadot        #address-cells = <1>;
101c66ec88fSEmmanuel Vadot        #size-cells = <0>;
102c66ec88fSEmmanuel Vadot
103c66ec88fSEmmanuel Vadot        tps6598x: tps6598x@38 {
104c66ec88fSEmmanuel Vadot            compatible = "ti,tps6598x";
105c66ec88fSEmmanuel Vadot            reg = <0x38>;
106cb7aa33aSEmmanuel Vadot            wakeup-source;
107c66ec88fSEmmanuel Vadot
108c66ec88fSEmmanuel Vadot            interrupt-parent = <&msmgpio>;
109c66ec88fSEmmanuel Vadot            interrupts = <107 IRQ_TYPE_LEVEL_LOW>;
110c66ec88fSEmmanuel Vadot            interrupt-names = "irq";
111c66ec88fSEmmanuel Vadot
112c66ec88fSEmmanuel Vadot            pinctrl-names = "default";
113c66ec88fSEmmanuel Vadot            pinctrl-0 = <&typec_pins>;
114*8d13bc63SEmmanuel Vadot            reset-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
115c66ec88fSEmmanuel Vadot
116c66ec88fSEmmanuel Vadot            typec_con: connector {
117c66ec88fSEmmanuel Vadot                compatible = "usb-c-connector";
118c66ec88fSEmmanuel Vadot                label = "USB-C";
119c66ec88fSEmmanuel Vadot                port {
120c66ec88fSEmmanuel Vadot                    typec_ep: endpoint {
121c66ec88fSEmmanuel Vadot                        remote-endpoint = <&otg_ep>;
122c66ec88fSEmmanuel Vadot                    };
123c66ec88fSEmmanuel Vadot                };
124c66ec88fSEmmanuel Vadot            };
125c66ec88fSEmmanuel Vadot        };
126c66ec88fSEmmanuel Vadot    };
12784943d6fSEmmanuel Vadot
12884943d6fSEmmanuel Vadot  - |
12984943d6fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
13084943d6fSEmmanuel Vadot    i2c {
13184943d6fSEmmanuel Vadot        #address-cells = <1>;
13284943d6fSEmmanuel Vadot        #size-cells = <0>;
13384943d6fSEmmanuel Vadot
13484943d6fSEmmanuel Vadot        typec@21 {
13584943d6fSEmmanuel Vadot            compatible = "ti,tps25750";
13684943d6fSEmmanuel Vadot            reg = <0x21>, <0x0f>;
13784943d6fSEmmanuel Vadot            reg-names = "main", "patch-address";
13884943d6fSEmmanuel Vadot
13984943d6fSEmmanuel Vadot            interrupt-parent = <&msmgpio>;
14084943d6fSEmmanuel Vadot            interrupts = <100 IRQ_TYPE_LEVEL_LOW>;
14184943d6fSEmmanuel Vadot            interrupt-names = "irq";
14284943d6fSEmmanuel Vadot            firmware-name = "tps25750.bin";
14384943d6fSEmmanuel Vadot
14484943d6fSEmmanuel Vadot            pinctrl-names = "default";
14584943d6fSEmmanuel Vadot            pinctrl-0 = <&typec_pins>;
14684943d6fSEmmanuel Vadot
14784943d6fSEmmanuel Vadot            typec_con0: connector {
14884943d6fSEmmanuel Vadot                compatible = "usb-c-connector";
14984943d6fSEmmanuel Vadot                label = "USB-C";
15084943d6fSEmmanuel Vadot                data-role = "dual";
15184943d6fSEmmanuel Vadot                port {
15284943d6fSEmmanuel Vadot                    typec_ep0: endpoint {
15384943d6fSEmmanuel Vadot                        remote-endpoint = <&otg_ep>;
15484943d6fSEmmanuel Vadot                    };
15584943d6fSEmmanuel Vadot                };
15684943d6fSEmmanuel Vadot            };
15784943d6fSEmmanuel Vadot        };
15884943d6fSEmmanuel Vadot    };
159c66ec88fSEmmanuel Vadot...
160