xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/google,cros-ec.yaml (revision e67e85659c0de33e617e5fbf1028c6e8b49eee53)
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  - Guenter Roeck <groeck@chromium.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription:
14c66ec88fSEmmanuel Vadot  Google's ChromeOS EC is a microcontroller which talks to the AP and
15c66ec88fSEmmanuel Vadot  implements various functions such as keyboard and battery charging.
16c66ec88fSEmmanuel Vadot  The EC can be connected through various interfaces (I2C, SPI, and others)
17c66ec88fSEmmanuel Vadot  and the compatible string specifies which interface is being used.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadotproperties:
20c66ec88fSEmmanuel Vadot  compatible:
21c66ec88fSEmmanuel Vadot    oneOf:
22c66ec88fSEmmanuel Vadot      - description:
23c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through I2C.
24c66ec88fSEmmanuel Vadot        const: google,cros-ec-i2c
25c66ec88fSEmmanuel Vadot      - description:
26c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through SPI.
27c66ec88fSEmmanuel Vadot        const: google,cros-ec-spi
28c66ec88fSEmmanuel Vadot      - description:
29c66ec88fSEmmanuel Vadot          For implementations of the EC is connected through RPMSG.
30c66ec88fSEmmanuel Vadot        const: google,cros-ec-rpmsg
31c66ec88fSEmmanuel Vadot
326be33864SEmmanuel Vadot  controller-data:
336be33864SEmmanuel Vadot    description:
346be33864SEmmanuel Vadot      SPI controller data, see bindings/spi/spi-samsung.txt
356be33864SEmmanuel Vadot    type: object
366be33864SEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  google,cros-ec-spi-pre-delay:
38c66ec88fSEmmanuel Vadot    description:
39c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between the
40c66ec88fSEmmanuel Vadot      assertion of the CS and the first clock pulse.
41c66ec88fSEmmanuel Vadot    allOf:
42c66ec88fSEmmanuel Vadot      - $ref: /schemas/types.yaml#/definitions/uint32
43c66ec88fSEmmanuel Vadot      - default: 0
44c66ec88fSEmmanuel Vadot      - minimum: 0
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  google,cros-ec-spi-msg-delay:
47c66ec88fSEmmanuel Vadot    description:
48c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between messages.
49c66ec88fSEmmanuel Vadot    allOf:
50c66ec88fSEmmanuel Vadot      - $ref: /schemas/types.yaml#/definitions/uint32
51c66ec88fSEmmanuel Vadot      - default: 0
52c66ec88fSEmmanuel Vadot      - minimum: 0
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot  google,has-vbc-nvram:
55c66ec88fSEmmanuel Vadot    description:
56c66ec88fSEmmanuel Vadot      Some implementations of the EC include a small nvram space used to
57c66ec88fSEmmanuel Vadot      store verified boot context data. This boolean flag is used to specify
58c66ec88fSEmmanuel Vadot      whether this nvram is present or not.
59c66ec88fSEmmanuel Vadot    type: boolean
60c66ec88fSEmmanuel Vadot
61*e67e8565SEmmanuel Vadot  mediatek,rpmsg-name:
626be33864SEmmanuel Vadot    description:
636be33864SEmmanuel Vadot      Must be defined if the cros-ec is a rpmsg device for a Mediatek
646be33864SEmmanuel Vadot      ARM Cortex M4 Co-processor. Contains the name pf the rpmsg
656be33864SEmmanuel Vadot      device. Used to match the subnode to the rpmsg device announced by
666be33864SEmmanuel Vadot      the SCP.
676be33864SEmmanuel Vadot    $ref: "/schemas/types.yaml#/definitions/string"
686be33864SEmmanuel Vadot
69c66ec88fSEmmanuel Vadot  spi-max-frequency:
70c66ec88fSEmmanuel Vadot    description: Maximum SPI frequency of the device in Hz.
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  reg:
73c66ec88fSEmmanuel Vadot    maxItems: 1
74c66ec88fSEmmanuel Vadot
75c66ec88fSEmmanuel Vadot  interrupts:
76c66ec88fSEmmanuel Vadot    maxItems: 1
77c66ec88fSEmmanuel Vadot
786be33864SEmmanuel Vadot  wakeup-source:
796be33864SEmmanuel Vadot    description: Button can wake-up the system.
806be33864SEmmanuel Vadot
816be33864SEmmanuel Vadot  '#address-cells':
826be33864SEmmanuel Vadot    const: 1
836be33864SEmmanuel Vadot
846be33864SEmmanuel Vadot  '#size-cells':
856be33864SEmmanuel Vadot    const: 0
866be33864SEmmanuel Vadot
876be33864SEmmanuel Vadot  typec:
886be33864SEmmanuel Vadot    $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"
896be33864SEmmanuel Vadot
906be33864SEmmanuel Vadot  ec-pwm:
916be33864SEmmanuel Vadot    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
926be33864SEmmanuel Vadot
936be33864SEmmanuel Vadot  keyboard-controller:
946be33864SEmmanuel Vadot    $ref: "/schemas/input/google,cros-ec-keyb.yaml#"
956be33864SEmmanuel Vadot
962eb4d8dcSEmmanuel Vadot  proximity:
972eb4d8dcSEmmanuel Vadot    $ref: "/schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#"
982eb4d8dcSEmmanuel Vadot
996be33864SEmmanuel Vadot  codecs:
1006be33864SEmmanuel Vadot    type: object
1016be33864SEmmanuel Vadot    additionalProperties: false
1026be33864SEmmanuel Vadot
1036be33864SEmmanuel Vadot    properties:
1046be33864SEmmanuel Vadot      '#address-cells':
1056be33864SEmmanuel Vadot        const: 2
1066be33864SEmmanuel Vadot
1076be33864SEmmanuel Vadot      '#size-cells':
1086be33864SEmmanuel Vadot        const: 1
1096be33864SEmmanuel Vadot
1106be33864SEmmanuel Vadot    patternProperties:
1116be33864SEmmanuel Vadot      "^ec-codec@[a-f0-9]+$":
1126be33864SEmmanuel Vadot        type: object
1136be33864SEmmanuel Vadot        $ref: "/schemas/sound/google,cros-ec-codec.yaml#"
1146be33864SEmmanuel Vadot
1156be33864SEmmanuel Vadot    required:
1166be33864SEmmanuel Vadot      - "#address-cells"
1176be33864SEmmanuel Vadot      - "#size-cells"
1186be33864SEmmanuel Vadot
1195956d97fSEmmanuel Vadot  cbas:
1205956d97fSEmmanuel Vadot    type: object
1215956d97fSEmmanuel Vadot
1225956d97fSEmmanuel Vadot    description:
1235956d97fSEmmanuel Vadot      This device is used to signal when a detachable base is attached
1245956d97fSEmmanuel Vadot      to a Chrome OS tablet. This device cannot be detected at runtime.
1255956d97fSEmmanuel Vadot
1265956d97fSEmmanuel Vadot    properties:
1275956d97fSEmmanuel Vadot      compatible:
1285956d97fSEmmanuel Vadot        const: google,cros-cbas
1295956d97fSEmmanuel Vadot
1305956d97fSEmmanuel Vadot    required:
1315956d97fSEmmanuel Vadot      - compatible
1325956d97fSEmmanuel Vadot
1335956d97fSEmmanuel Vadot    additionalProperties: false
1345956d97fSEmmanuel Vadot
1356be33864SEmmanuel VadotpatternProperties:
1366be33864SEmmanuel Vadot  "^i2c-tunnel[0-9]*$":
1376be33864SEmmanuel Vadot    type: object
1386be33864SEmmanuel Vadot    $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
1396be33864SEmmanuel Vadot
1406be33864SEmmanuel Vadot  "^regulator@[0-9]+$":
1416be33864SEmmanuel Vadot    type: object
1426be33864SEmmanuel Vadot    $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"
1436be33864SEmmanuel Vadot
1446be33864SEmmanuel Vadot  "^extcon[0-9]*$":
1456be33864SEmmanuel Vadot    type: object
1466be33864SEmmanuel Vadot    $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"
1476be33864SEmmanuel Vadot
148c66ec88fSEmmanuel Vadotrequired:
149c66ec88fSEmmanuel Vadot  - compatible
150c66ec88fSEmmanuel Vadot
151c66ec88fSEmmanuel Vadotif:
152c66ec88fSEmmanuel Vadot  properties:
153c66ec88fSEmmanuel Vadot    compatible:
154c66ec88fSEmmanuel Vadot      contains:
155c66ec88fSEmmanuel Vadot        enum:
156c66ec88fSEmmanuel Vadot          - google,cros-ec-i2c
157c66ec88fSEmmanuel Vadot          - google,cros-ec-rpmsg
158c66ec88fSEmmanuel Vadotthen:
159c66ec88fSEmmanuel Vadot  properties:
160c66ec88fSEmmanuel Vadot    google,cros-ec-spi-pre-delay: false
161c66ec88fSEmmanuel Vadot    google,cros-ec-spi-msg-delay: false
162c66ec88fSEmmanuel Vadot    spi-max-frequency: false
163c66ec88fSEmmanuel Vadot
164c66ec88fSEmmanuel VadotadditionalProperties: false
165c66ec88fSEmmanuel Vadot
166c66ec88fSEmmanuel Vadotexamples:
167c66ec88fSEmmanuel Vadot  # Example for I2C
168c66ec88fSEmmanuel Vadot  - |
169c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
170c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
171c66ec88fSEmmanuel Vadot
172c66ec88fSEmmanuel Vadot    i2c0 {
173c66ec88fSEmmanuel Vadot        #address-cells = <1>;
174c66ec88fSEmmanuel Vadot        #size-cells = <0>;
175c66ec88fSEmmanuel Vadot
176c66ec88fSEmmanuel Vadot        cros-ec@1e {
177c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-i2c";
178c66ec88fSEmmanuel Vadot            reg = <0x1e>;
179c66ec88fSEmmanuel Vadot            interrupts = <6 0>;
180c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio0>;
181c66ec88fSEmmanuel Vadot        };
182c66ec88fSEmmanuel Vadot    };
183c66ec88fSEmmanuel Vadot
184c66ec88fSEmmanuel Vadot  # Example for SPI
185c66ec88fSEmmanuel Vadot  - |
186c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
187c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
188c66ec88fSEmmanuel Vadot
189c66ec88fSEmmanuel Vadot    spi0 {
190c66ec88fSEmmanuel Vadot        #address-cells = <1>;
191c66ec88fSEmmanuel Vadot        #size-cells = <0>;
192c66ec88fSEmmanuel Vadot
193c66ec88fSEmmanuel Vadot        cros-ec@0 {
194c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-spi";
195c66ec88fSEmmanuel Vadot            reg = <0x0>;
196c66ec88fSEmmanuel Vadot            google,cros-ec-spi-msg-delay = <30>;
197c66ec88fSEmmanuel Vadot            google,cros-ec-spi-pre-delay = <10>;
198c66ec88fSEmmanuel Vadot            interrupts = <99 0>;
199c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio7>;
200c66ec88fSEmmanuel Vadot            spi-max-frequency = <5000000>;
2012eb4d8dcSEmmanuel Vadot
2022eb4d8dcSEmmanuel Vadot            proximity {
2032eb4d8dcSEmmanuel Vadot                    compatible = "google,cros-ec-mkbp-proximity";
2042eb4d8dcSEmmanuel Vadot            };
2055956d97fSEmmanuel Vadot
2065956d97fSEmmanuel Vadot            cbas {
2075956d97fSEmmanuel Vadot                compatible = "google,cros-cbas";
2085956d97fSEmmanuel Vadot            };
209c66ec88fSEmmanuel Vadot        };
210c66ec88fSEmmanuel Vadot    };
211c66ec88fSEmmanuel Vadot
212c66ec88fSEmmanuel Vadot  # Example for RPMSG
213c66ec88fSEmmanuel Vadot  - |
214c66ec88fSEmmanuel Vadot    scp0 {
215c66ec88fSEmmanuel Vadot        cros-ec {
216c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-rpmsg";
217c66ec88fSEmmanuel Vadot        };
218c66ec88fSEmmanuel Vadot    };
219c66ec88fSEmmanuel Vadot...
220