146b57806SIkjoon Jang# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
246b57806SIkjoon Jang%YAML 1.2
346b57806SIkjoon Jang---
446b57806SIkjoon Jang$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
546b57806SIkjoon Jang$schema: http://devicetree.org/meta-schemas/core.yaml#
646b57806SIkjoon Jang
746b57806SIkjoon Jangtitle: ChromeOS Embedded Controller
846b57806SIkjoon Jang
946b57806SIkjoon Jangmaintainers:
1046b57806SIkjoon Jang  - Benson Leung <bleung@chromium.org>
1146b57806SIkjoon Jang  - Guenter Roeck <groeck@chromium.org>
1246b57806SIkjoon Jang
1346b57806SIkjoon Jangdescription:
1446b57806SIkjoon Jang  Google's ChromeOS EC is a microcontroller which talks to the AP and
1546b57806SIkjoon Jang  implements various functions such as keyboard and battery charging.
1646b57806SIkjoon Jang  The EC can be connected through various interfaces (I2C, SPI, and others)
1746b57806SIkjoon Jang  and the compatible string specifies which interface is being used.
1846b57806SIkjoon Jang
1946b57806SIkjoon Jangproperties:
2046b57806SIkjoon Jang  compatible:
2146b57806SIkjoon Jang    oneOf:
2246b57806SIkjoon Jang      - description:
23*7a2f3682SStephen Boyd          For implementations of the EC connected through I2C.
2446b57806SIkjoon Jang        const: google,cros-ec-i2c
2546b57806SIkjoon Jang      - description:
26*7a2f3682SStephen Boyd          For implementations of the EC connected through SPI.
2746b57806SIkjoon Jang        const: google,cros-ec-spi
2846b57806SIkjoon Jang      - description:
29*7a2f3682SStephen Boyd          For implementations of the EC connected through RPMSG.
3046b57806SIkjoon Jang        const: google,cros-ec-rpmsg
3146b57806SIkjoon Jang
32*7a2f3682SStephen Boyd  controller-data: true
335d7fb8b8SKrzysztof Kozlowski
3446b57806SIkjoon Jang  google,cros-ec-spi-pre-delay:
3546b57806SIkjoon Jang    description:
3646b57806SIkjoon Jang      This property specifies the delay in usecs between the
3746b57806SIkjoon Jang      assertion of the CS and the first clock pulse.
38dca66935SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
39dca66935SRob Herring    default: 0
4046b57806SIkjoon Jang
4146b57806SIkjoon Jang  google,cros-ec-spi-msg-delay:
4246b57806SIkjoon Jang    description:
4346b57806SIkjoon Jang      This property specifies the delay in usecs between messages.
44dca66935SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
45dca66935SRob Herring    default: 0
4646b57806SIkjoon Jang
4746b57806SIkjoon Jang  google,has-vbc-nvram:
4846b57806SIkjoon Jang    description:
4946b57806SIkjoon Jang      Some implementations of the EC include a small nvram space used to
5046b57806SIkjoon Jang      store verified boot context data. This boolean flag is used to specify
5146b57806SIkjoon Jang      whether this nvram is present or not.
5246b57806SIkjoon Jang    type: boolean
5346b57806SIkjoon Jang
54e565615cSMatthias Brugger  mediatek,rpmsg-name:
555c024e68SRicardo Cañuelo    description:
565c024e68SRicardo Cañuelo      Must be defined if the cros-ec is a rpmsg device for a Mediatek
57f93afd8eSStephen Boyd      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
585c024e68SRicardo Cañuelo      device. Used to match the subnode to the rpmsg device announced by
595c024e68SRicardo Cañuelo      the SCP.
605c024e68SRicardo Cañuelo    $ref: "/schemas/types.yaml#/definitions/string"
615c024e68SRicardo Cañuelo
62*7a2f3682SStephen Boyd  spi-max-frequency: true
6346b57806SIkjoon Jang
6446b57806SIkjoon Jang  reg:
6546b57806SIkjoon Jang    maxItems: 1
6646b57806SIkjoon Jang
6746b57806SIkjoon Jang  interrupts:
6846b57806SIkjoon Jang    maxItems: 1
6946b57806SIkjoon Jang
705d7fb8b8SKrzysztof Kozlowski  wakeup-source:
715d7fb8b8SKrzysztof Kozlowski    description: Button can wake-up the system.
725d7fb8b8SKrzysztof Kozlowski
735c024e68SRicardo Cañuelo  '#address-cells':
745c024e68SRicardo Cañuelo    const: 1
755c024e68SRicardo Cañuelo
765c024e68SRicardo Cañuelo  '#size-cells':
775c024e68SRicardo Cañuelo    const: 0
785c024e68SRicardo Cañuelo
795c024e68SRicardo Cañuelo  typec:
805c024e68SRicardo Cañuelo    $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"
815c024e68SRicardo Cañuelo
825c024e68SRicardo Cañuelo  ec-pwm:
835c024e68SRicardo Cañuelo    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
846b94ee66SKrzysztof Kozlowski    deprecated: true
856b94ee66SKrzysztof Kozlowski
866b94ee66SKrzysztof Kozlowski  pwm:
876b94ee66SKrzysztof Kozlowski    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
885c024e68SRicardo Cañuelo
8920f370efSTzung-Bi Shih  kbd-led-backlight:
9020f370efSTzung-Bi Shih    $ref: "/schemas/chrome/google,cros-kbd-led-backlight.yaml#"
9120f370efSTzung-Bi Shih
9250d68feeSRicardo Cañuelo  keyboard-controller:
9350d68feeSRicardo Cañuelo    $ref: "/schemas/input/google,cros-ec-keyb.yaml#"
9450d68feeSRicardo Cañuelo
9519ad93bcSStephen Boyd  proximity:
9619ad93bcSStephen Boyd    $ref: "/schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#"
9719ad93bcSStephen Boyd
985c024e68SRicardo Cañuelo  codecs:
995c024e68SRicardo Cañuelo    type: object
1005c024e68SRicardo Cañuelo    additionalProperties: false
1015c024e68SRicardo Cañuelo
1025c024e68SRicardo Cañuelo    properties:
1035c024e68SRicardo Cañuelo      '#address-cells':
1045c024e68SRicardo Cañuelo        const: 2
1055c024e68SRicardo Cañuelo
1065c024e68SRicardo Cañuelo      '#size-cells':
1075c024e68SRicardo Cañuelo        const: 1
1085c024e68SRicardo Cañuelo
1095c024e68SRicardo Cañuelo    patternProperties:
1105c024e68SRicardo Cañuelo      "^ec-codec@[a-f0-9]+$":
1115c024e68SRicardo Cañuelo        type: object
1125c024e68SRicardo Cañuelo        $ref: "/schemas/sound/google,cros-ec-codec.yaml#"
1135c024e68SRicardo Cañuelo
1145c024e68SRicardo Cañuelo    required:
1155c024e68SRicardo Cañuelo      - "#address-cells"
1165c024e68SRicardo Cañuelo      - "#size-cells"
1175c024e68SRicardo Cañuelo
11880cf16deSIkjoon Jang  cbas:
11980cf16deSIkjoon Jang    type: object
12080cf16deSIkjoon Jang
12180cf16deSIkjoon Jang    description:
12280cf16deSIkjoon Jang      This device is used to signal when a detachable base is attached
12380cf16deSIkjoon Jang      to a Chrome OS tablet. This device cannot be detected at runtime.
12480cf16deSIkjoon Jang
12580cf16deSIkjoon Jang    properties:
12680cf16deSIkjoon Jang      compatible:
12780cf16deSIkjoon Jang        const: google,cros-cbas
12880cf16deSIkjoon Jang
12980cf16deSIkjoon Jang    required:
13080cf16deSIkjoon Jang      - compatible
13180cf16deSIkjoon Jang
13280cf16deSIkjoon Jang    additionalProperties: false
13380cf16deSIkjoon Jang
1341acd4577SRicardo CañuelopatternProperties:
1351acd4577SRicardo Cañuelo  "^i2c-tunnel[0-9]*$":
1361acd4577SRicardo Cañuelo    type: object
1371acd4577SRicardo Cañuelo    $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
1381acd4577SRicardo Cañuelo
1395c024e68SRicardo Cañuelo  "^regulator@[0-9]+$":
1405c024e68SRicardo Cañuelo    type: object
1415c024e68SRicardo Cañuelo    $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"
1425c024e68SRicardo Cañuelo
1435c024e68SRicardo Cañuelo  "^extcon[0-9]*$":
1445c024e68SRicardo Cañuelo    type: object
1455c024e68SRicardo Cañuelo    $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"
1465c024e68SRicardo Cañuelo
14746b57806SIkjoon Jangrequired:
14846b57806SIkjoon Jang  - compatible
14946b57806SIkjoon Jang
150f412fe11SKrzysztof KozlowskiallOf:
151f412fe11SKrzysztof Kozlowski  - if:
15246b57806SIkjoon Jang      properties:
15346b57806SIkjoon Jang        compatible:
154*7a2f3682SStephen Boyd          not:
15546b57806SIkjoon Jang            contains:
156*7a2f3682SStephen Boyd              const: google,cros-ec-spi
15746b57806SIkjoon Jang    then:
15846b57806SIkjoon Jang      properties:
159*7a2f3682SStephen Boyd        controller-data: false
16046b57806SIkjoon Jang        google,cros-ec-spi-pre-delay: false
16146b57806SIkjoon Jang        google,cros-ec-spi-msg-delay: false
16246b57806SIkjoon Jang        spi-max-frequency: false
163f412fe11SKrzysztof Kozlowski    else:
164f412fe11SKrzysztof Kozlowski      $ref: /schemas/spi/spi-peripheral-props.yaml
16546b57806SIkjoon Jang
166*7a2f3682SStephen Boyd  - if:
167*7a2f3682SStephen Boyd      properties:
168*7a2f3682SStephen Boyd        compatible:
169*7a2f3682SStephen Boyd          not:
170*7a2f3682SStephen Boyd            contains:
171*7a2f3682SStephen Boyd              const: google,cros-ec-rpmsg
172*7a2f3682SStephen Boyd    then:
173*7a2f3682SStephen Boyd      properties:
174*7a2f3682SStephen Boyd        mediatek,rpmsg-name: false
175*7a2f3682SStephen Boyd
176*7a2f3682SStephen Boyd      required:
177*7a2f3682SStephen Boyd        - reg
178*7a2f3682SStephen Boyd        - interrupts
179*7a2f3682SStephen Boyd
18046b57806SIkjoon JangadditionalProperties: false
18146b57806SIkjoon Jang
18246b57806SIkjoon Jangexamples:
18346b57806SIkjoon Jang  # Example for I2C
18446b57806SIkjoon Jang  - |
18546b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
18646b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
18746b57806SIkjoon Jang
18846b57806SIkjoon Jang    i2c0 {
18946b57806SIkjoon Jang        #address-cells = <1>;
19046b57806SIkjoon Jang        #size-cells = <0>;
19146b57806SIkjoon Jang
19246b57806SIkjoon Jang        cros-ec@1e {
19346b57806SIkjoon Jang            compatible = "google,cros-ec-i2c";
19446b57806SIkjoon Jang            reg = <0x1e>;
19546b57806SIkjoon Jang            interrupts = <6 0>;
19646b57806SIkjoon Jang            interrupt-parent = <&gpio0>;
19746b57806SIkjoon Jang        };
19846b57806SIkjoon Jang    };
19946b57806SIkjoon Jang
20046b57806SIkjoon Jang  # Example for SPI
20146b57806SIkjoon Jang  - |
20246b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
20346b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
20446b57806SIkjoon Jang
20546b57806SIkjoon Jang    spi0 {
20646b57806SIkjoon Jang        #address-cells = <1>;
20746b57806SIkjoon Jang        #size-cells = <0>;
20846b57806SIkjoon Jang
20946b57806SIkjoon Jang        cros-ec@0 {
21046b57806SIkjoon Jang            compatible = "google,cros-ec-spi";
21146b57806SIkjoon Jang            reg = <0x0>;
21246b57806SIkjoon Jang            google,cros-ec-spi-msg-delay = <30>;
21346b57806SIkjoon Jang            google,cros-ec-spi-pre-delay = <10>;
21446b57806SIkjoon Jang            interrupts = <99 0>;
21546b57806SIkjoon Jang            interrupt-parent = <&gpio7>;
21646b57806SIkjoon Jang            spi-max-frequency = <5000000>;
21719ad93bcSStephen Boyd
21819ad93bcSStephen Boyd            proximity {
21919ad93bcSStephen Boyd                compatible = "google,cros-ec-mkbp-proximity";
22019ad93bcSStephen Boyd            };
22180cf16deSIkjoon Jang
22280cf16deSIkjoon Jang            cbas {
22380cf16deSIkjoon Jang                compatible = "google,cros-cbas";
22480cf16deSIkjoon Jang            };
22546b57806SIkjoon Jang        };
22646b57806SIkjoon Jang    };
22746b57806SIkjoon Jang
22846b57806SIkjoon Jang  # Example for RPMSG
22946b57806SIkjoon Jang  - |
23046b57806SIkjoon Jang    scp0 {
23146b57806SIkjoon Jang        cros-ec {
23246b57806SIkjoon Jang            compatible = "google,cros-ec-rpmsg";
23346b57806SIkjoon Jang        };
23446b57806SIkjoon Jang    };
23546b57806SIkjoon Jang...
236