summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
blob: f49c0d5d31ad20ed82ae5658a0f0f3f0c8fd043b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ChromeOS Embedded Controller

maintainers:
  - Benson Leung <bleung@chromium.org>
  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
  - Guenter Roeck <groeck@chromium.org>

description:
  Google's ChromeOS EC is a microcontroller which talks to the AP and
  implements various functions such as keyboard and battery charging.
  The EC can be connected through various interfaces (I2C, SPI, and others)
  and the compatible string specifies which interface is being used.

properties:
  compatible:
    oneOf:
      - description:
          For implementations of the EC is connected through I2C.
        const: google,cros-ec-i2c
      - description:
          For implementations of the EC is connected through SPI.
        const: google,cros-ec-spi
      - description:
          For implementations of the EC is connected through RPMSG.
        const: google,cros-ec-rpmsg

  controller-data:
    description:
      SPI controller data, see bindings/spi/spi-samsung.txt
    type: object

  google,cros-ec-spi-pre-delay:
    description:
      This property specifies the delay in usecs between the
      assertion of the CS and the first clock pulse.
    allOf:
      - $ref: /schemas/types.yaml#/definitions/uint32
      - default: 0
      - minimum: 0

  google,cros-ec-spi-msg-delay:
    description:
      This property specifies the delay in usecs between messages.
    allOf:
      - $ref: /schemas/types.yaml#/definitions/uint32
      - default: 0
      - minimum: 0

  google,has-vbc-nvram:
    description:
      Some implementations of the EC include a small nvram space used to
      store verified boot context data. This boolean flag is used to specify
      whether this nvram is present or not.
    type: boolean

  spi-max-frequency:
    description: Maximum SPI frequency of the device in Hz.

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  wakeup-source:
    description: Button can wake-up the system.

required:
  - compatible

if:
  properties:
    compatible:
      contains:
        enum:
          - google,cros-ec-i2c
          - google,cros-ec-rpmsg
then:
  properties:
    google,cros-ec-spi-pre-delay: false
    google,cros-ec-spi-msg-delay: false
    spi-max-frequency: false

additionalProperties: false

examples:
  # Example for I2C
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c0 {
        #address-cells = <1>;
        #size-cells = <0>;

        cros-ec@1e {
            compatible = "google,cros-ec-i2c";
            reg = <0x1e>;
            interrupts = <6 0>;
            interrupt-parent = <&gpio0>;
        };
    };

  # Example for SPI
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    spi0 {
        #address-cells = <1>;
        #size-cells = <0>;

        cros-ec@0 {
            compatible = "google,cros-ec-spi";
            reg = <0x0>;
            google,cros-ec-spi-msg-delay = <30>;
            google,cros-ec-spi-pre-delay = <10>;
            interrupts = <99 0>;
            interrupt-parent = <&gpio7>;
            spi-max-frequency = <5000000>;
        };
    };

  # Example for RPMSG
  - |
    scp0 {
        cros-ec {
            compatible = "google,cros-ec-rpmsg";
        };
    };
...