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