xref: /linux/Documentation/devicetree/bindings/platform/huawei,gaokun-ec.yaml (revision bbfd5594756011167b8f8de9a00e0c946afda1e6)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/platform/huawei,gaokun-ec.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Huawei Matebook E Go Embedded Controller
8
9maintainers:
10  - Pengyu Luo <mitltlatltl@gmail.com>
11
12description:
13  Different from other Qualcomm Snapdragon sc8180x and sc8280xp-based
14  machines, the Huawei Matebook E Go tablets use embedded controllers
15  while others use a system called PMIC GLink which handles battery,
16  UCSI, USB Type-C DP Alt Mode. In addition, Huawei's implementation
17  also handles additional features, such as charging thresholds, FN
18  lock, smart charging, tablet lid status, thermal sensors, and more.
19
20properties:
21  compatible:
22    enum:
23      - huawei,gaokun3-ec
24
25  reg:
26    const: 0x38
27
28  '#address-cells':
29    const: 1
30
31  '#size-cells':
32    const: 0
33
34  interrupts:
35    maxItems: 1
36
37patternProperties:
38  '^connector@[01]$':
39    $ref: /schemas/connector/usb-connector.yaml#
40
41    properties:
42      reg:
43        maxItems: 1
44
45required:
46  - compatible
47  - reg
48  - interrupts
49
50additionalProperties: false
51
52examples:
53  - |
54    #include <dt-bindings/interrupt-controller/irq.h>
55    i2c {
56        #address-cells = <1>;
57        #size-cells = <0>;
58
59        embedded-controller@38 {
60            compatible = "huawei,gaokun3-ec";
61            reg = <0x38>;
62
63            interrupts-extended = <&tlmm 107 IRQ_TYPE_LEVEL_LOW>;
64
65            #address-cells = <1>;
66            #size-cells = <0>;
67
68            connector@0 {
69                compatible = "usb-c-connector";
70                reg = <0>;
71                power-role = "dual";
72                data-role = "dual";
73
74                ports {
75                    #address-cells = <1>;
76                    #size-cells = <0>;
77
78                    port@0 {
79                        reg = <0>;
80
81                        ucsi0_ss_in: endpoint {
82                            remote-endpoint = <&usb_0_qmpphy_out>;
83                        };
84                    };
85
86                    port@1 {
87                        reg = <1>;
88
89                        ucsi0_sbu: endpoint {
90                            remote-endpoint = <&usb0_sbu_mux>;
91                        };
92                    };
93                };
94            };
95
96            connector@1 {
97                compatible = "usb-c-connector";
98                reg = <1>;
99                power-role = "dual";
100                data-role = "dual";
101
102                ports {
103                    #address-cells = <1>;
104                    #size-cells = <0>;
105
106                    port@0 {
107                        reg = <0>;
108
109                        ucsi1_ss_in: endpoint {
110                            remote-endpoint = <&usb_1_qmpphy_out>;
111                        };
112                    };
113
114                    port@1 {
115                        reg = <1>;
116
117                        ucsi1_sbu: endpoint {
118                            remote-endpoint = <&usb1_sbu_mux>;
119                        };
120                    };
121                };
122            };
123        };
124    };
125