1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/usb/st,typec-stm32g0.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: STMicroelectronics STM32G0 USB Type-C PD controller
8
9description: |
10  The STM32G0 MCU can be programmed to control Type-C connector(s) through I2C
11  typically using the UCSI protocol over I2C, with a dedicated alert
12  (interrupt) pin.
13
14maintainers:
15  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
16
17properties:
18  compatible:
19    const: st,stm32g0-typec
20
21  reg:
22    maxItems: 1
23
24  interrupts:
25    maxItems: 1
26
27  connector:
28    type: object
29    $ref: /schemas/connector/usb-connector.yaml#
30    unevaluatedProperties: false
31
32  firmware-name:
33    description: |
34      Should contain the name of the default firmware image
35      file located on the firmware search path
36
37  wakeup-source: true
38
39  power-domains:
40    maxItems: 1
41
42required:
43  - compatible
44  - reg
45  - interrupts
46  - connector
47
48additionalProperties: false
49
50examples:
51  - |
52    #include <dt-bindings/interrupt-controller/irq.h>
53    i2c {
54      #address-cells = <1>;
55      #size-cells = <0>;
56
57      typec@53 {
58        compatible = "st,stm32g0-typec";
59        reg = <0x53>;
60        /* Alert pin on GPIO PE12 */
61        interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
62        interrupt-parent = <&gpioe>;
63
64        /* Example with one type-C connector */
65        connector {
66          compatible = "usb-c-connector";
67          label = "USB-C";
68
69          ports {
70            #address-cells = <1>;
71            #size-cells = <0>;
72            port@0 {
73              reg = <0>;
74              con_usb_c_ep: endpoint {
75                remote-endpoint = <&usb_ep>;
76              };
77            };
78          };
79        };
80      };
81    };
82
83    usb {
84      usb-role-switch;
85      port {
86        usb_ep: endpoint {
87          remote-endpoint = <&con_usb_c_ep>;
88        };
89      };
90    };
91...
92