xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/google,cros-ec.yaml (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: ChromeOS Embedded Controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Benson Leung <bleung@chromium.org>
11c66ec88fSEmmanuel Vadot  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
12c66ec88fSEmmanuel Vadot  - Guenter Roeck <groeck@chromium.org>
13c66ec88fSEmmanuel Vadot
14c66ec88fSEmmanuel Vadotdescription:
15c66ec88fSEmmanuel Vadot  Google's ChromeOS EC is a microcontroller which talks to the AP and
16c66ec88fSEmmanuel Vadot  implements various functions such as keyboard and battery charging.
17c66ec88fSEmmanuel Vadot  The EC can be connected through various interfaces (I2C, SPI, and others)
18c66ec88fSEmmanuel Vadot  and the compatible string specifies which interface is being used.
19c66ec88fSEmmanuel Vadot
20c66ec88fSEmmanuel Vadotproperties:
21c66ec88fSEmmanuel Vadot  compatible:
22c66ec88fSEmmanuel Vadot    oneOf:
23c66ec88fSEmmanuel Vadot      - description:
24c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through I2C.
25c66ec88fSEmmanuel Vadot        const: google,cros-ec-i2c
26c66ec88fSEmmanuel Vadot      - description:
27c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through SPI.
28c66ec88fSEmmanuel Vadot        const: google,cros-ec-spi
29c66ec88fSEmmanuel Vadot      - description:
30c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through RPMSG.
31c66ec88fSEmmanuel Vadot        const: google,cros-ec-rpmsg
32c66ec88fSEmmanuel Vadot
33*6be33864SEmmanuel Vadot  controller-data:
34*6be33864SEmmanuel Vadot    description:
35*6be33864SEmmanuel Vadot      SPI controller data, see bindings/spi/spi-samsung.txt
36*6be33864SEmmanuel Vadot    type: object
37*6be33864SEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  google,cros-ec-spi-pre-delay:
39c66ec88fSEmmanuel Vadot    description:
40c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between the
41c66ec88fSEmmanuel Vadot      assertion of the CS and the first clock pulse.
42c66ec88fSEmmanuel Vadot    allOf:
43c66ec88fSEmmanuel Vadot      - $ref: /schemas/types.yaml#/definitions/uint32
44c66ec88fSEmmanuel Vadot      - default: 0
45c66ec88fSEmmanuel Vadot      - minimum: 0
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  google,cros-ec-spi-msg-delay:
48c66ec88fSEmmanuel Vadot    description:
49c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between messages.
50c66ec88fSEmmanuel Vadot    allOf:
51c66ec88fSEmmanuel Vadot      - $ref: /schemas/types.yaml#/definitions/uint32
52c66ec88fSEmmanuel Vadot      - default: 0
53c66ec88fSEmmanuel Vadot      - minimum: 0
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot  google,has-vbc-nvram:
56c66ec88fSEmmanuel Vadot    description:
57c66ec88fSEmmanuel Vadot      Some implementations of the EC include a small nvram space used to
58c66ec88fSEmmanuel Vadot      store verified boot context data. This boolean flag is used to specify
59c66ec88fSEmmanuel Vadot      whether this nvram is present or not.
60c66ec88fSEmmanuel Vadot    type: boolean
61c66ec88fSEmmanuel Vadot
62*6be33864SEmmanuel Vadot  mtk,rpmsg-name:
63*6be33864SEmmanuel Vadot    description:
64*6be33864SEmmanuel Vadot      Must be defined if the cros-ec is a rpmsg device for a Mediatek
65*6be33864SEmmanuel Vadot      ARM Cortex M4 Co-processor. Contains the name pf the rpmsg
66*6be33864SEmmanuel Vadot      device. Used to match the subnode to the rpmsg device announced by
67*6be33864SEmmanuel Vadot      the SCP.
68*6be33864SEmmanuel Vadot    $ref: "/schemas/types.yaml#/definitions/string"
69*6be33864SEmmanuel Vadot
70c66ec88fSEmmanuel Vadot  spi-max-frequency:
71c66ec88fSEmmanuel Vadot    description: Maximum SPI frequency of the device in Hz.
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel Vadot  reg:
74c66ec88fSEmmanuel Vadot    maxItems: 1
75c66ec88fSEmmanuel Vadot
76c66ec88fSEmmanuel Vadot  interrupts:
77c66ec88fSEmmanuel Vadot    maxItems: 1
78c66ec88fSEmmanuel Vadot
79*6be33864SEmmanuel Vadot  wakeup-source:
80*6be33864SEmmanuel Vadot    description: Button can wake-up the system.
81*6be33864SEmmanuel Vadot
82*6be33864SEmmanuel Vadot  '#address-cells':
83*6be33864SEmmanuel Vadot    const: 1
84*6be33864SEmmanuel Vadot
85*6be33864SEmmanuel Vadot  '#size-cells':
86*6be33864SEmmanuel Vadot    const: 0
87*6be33864SEmmanuel Vadot
88*6be33864SEmmanuel Vadot  typec:
89*6be33864SEmmanuel Vadot    $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"
90*6be33864SEmmanuel Vadot
91*6be33864SEmmanuel Vadot  ec-pwm:
92*6be33864SEmmanuel Vadot    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
93*6be33864SEmmanuel Vadot
94*6be33864SEmmanuel Vadot  keyboard-controller:
95*6be33864SEmmanuel Vadot    $ref: "/schemas/input/google,cros-ec-keyb.yaml#"
96*6be33864SEmmanuel Vadot
97*6be33864SEmmanuel Vadot  codecs:
98*6be33864SEmmanuel Vadot    type: object
99*6be33864SEmmanuel Vadot    additionalProperties: false
100*6be33864SEmmanuel Vadot
101*6be33864SEmmanuel Vadot    properties:
102*6be33864SEmmanuel Vadot      '#address-cells':
103*6be33864SEmmanuel Vadot        const: 2
104*6be33864SEmmanuel Vadot
105*6be33864SEmmanuel Vadot      '#size-cells':
106*6be33864SEmmanuel Vadot        const: 1
107*6be33864SEmmanuel Vadot
108*6be33864SEmmanuel Vadot    patternProperties:
109*6be33864SEmmanuel Vadot      "^ec-codec@[a-f0-9]+$":
110*6be33864SEmmanuel Vadot        type: object
111*6be33864SEmmanuel Vadot        $ref: "/schemas/sound/google,cros-ec-codec.yaml#"
112*6be33864SEmmanuel Vadot
113*6be33864SEmmanuel Vadot    required:
114*6be33864SEmmanuel Vadot      - "#address-cells"
115*6be33864SEmmanuel Vadot      - "#size-cells"
116*6be33864SEmmanuel Vadot
117*6be33864SEmmanuel VadotpatternProperties:
118*6be33864SEmmanuel Vadot  "^i2c-tunnel[0-9]*$":
119*6be33864SEmmanuel Vadot    type: object
120*6be33864SEmmanuel Vadot    $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
121*6be33864SEmmanuel Vadot
122*6be33864SEmmanuel Vadot  "^regulator@[0-9]+$":
123*6be33864SEmmanuel Vadot    type: object
124*6be33864SEmmanuel Vadot    $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"
125*6be33864SEmmanuel Vadot
126*6be33864SEmmanuel Vadot  "^extcon[0-9]*$":
127*6be33864SEmmanuel Vadot    type: object
128*6be33864SEmmanuel Vadot    $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"
129*6be33864SEmmanuel Vadot
130c66ec88fSEmmanuel Vadotrequired:
131c66ec88fSEmmanuel Vadot  - compatible
132c66ec88fSEmmanuel Vadot
133c66ec88fSEmmanuel Vadotif:
134c66ec88fSEmmanuel Vadot  properties:
135c66ec88fSEmmanuel Vadot    compatible:
136c66ec88fSEmmanuel Vadot      contains:
137c66ec88fSEmmanuel Vadot        enum:
138c66ec88fSEmmanuel Vadot          - google,cros-ec-i2c
139c66ec88fSEmmanuel Vadot          - google,cros-ec-rpmsg
140c66ec88fSEmmanuel Vadotthen:
141c66ec88fSEmmanuel Vadot  properties:
142c66ec88fSEmmanuel Vadot    google,cros-ec-spi-pre-delay: false
143c66ec88fSEmmanuel Vadot    google,cros-ec-spi-msg-delay: false
144c66ec88fSEmmanuel Vadot    spi-max-frequency: false
145c66ec88fSEmmanuel Vadot
146c66ec88fSEmmanuel VadotadditionalProperties: false
147c66ec88fSEmmanuel Vadot
148c66ec88fSEmmanuel Vadotexamples:
149c66ec88fSEmmanuel Vadot  # Example for I2C
150c66ec88fSEmmanuel Vadot  - |
151c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
152c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
153c66ec88fSEmmanuel Vadot
154c66ec88fSEmmanuel Vadot    i2c0 {
155c66ec88fSEmmanuel Vadot        #address-cells = <1>;
156c66ec88fSEmmanuel Vadot        #size-cells = <0>;
157c66ec88fSEmmanuel Vadot
158c66ec88fSEmmanuel Vadot        cros-ec@1e {
159c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-i2c";
160c66ec88fSEmmanuel Vadot            reg = <0x1e>;
161c66ec88fSEmmanuel Vadot            interrupts = <6 0>;
162c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio0>;
163c66ec88fSEmmanuel Vadot        };
164c66ec88fSEmmanuel Vadot    };
165c66ec88fSEmmanuel Vadot
166c66ec88fSEmmanuel Vadot  # Example for SPI
167c66ec88fSEmmanuel Vadot  - |
168c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
169c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
170c66ec88fSEmmanuel Vadot
171c66ec88fSEmmanuel Vadot    spi0 {
172c66ec88fSEmmanuel Vadot        #address-cells = <1>;
173c66ec88fSEmmanuel Vadot        #size-cells = <0>;
174c66ec88fSEmmanuel Vadot
175c66ec88fSEmmanuel Vadot        cros-ec@0 {
176c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-spi";
177c66ec88fSEmmanuel Vadot            reg = <0x0>;
178c66ec88fSEmmanuel Vadot            google,cros-ec-spi-msg-delay = <30>;
179c66ec88fSEmmanuel Vadot            google,cros-ec-spi-pre-delay = <10>;
180c66ec88fSEmmanuel Vadot            interrupts = <99 0>;
181c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio7>;
182c66ec88fSEmmanuel Vadot            spi-max-frequency = <5000000>;
183c66ec88fSEmmanuel Vadot        };
184c66ec88fSEmmanuel Vadot    };
185c66ec88fSEmmanuel Vadot
186c66ec88fSEmmanuel Vadot  # Example for RPMSG
187c66ec88fSEmmanuel Vadot  - |
188c66ec88fSEmmanuel Vadot    scp0 {
189c66ec88fSEmmanuel Vadot        cros-ec {
190c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-rpmsg";
191c66ec88fSEmmanuel Vadot        };
192c66ec88fSEmmanuel Vadot    };
193c66ec88fSEmmanuel Vadot...
194