summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
blob: 0faa4da6c7c8725882b000c03cda6abaf329059e (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# 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

  mediatek,rpmsg-name:
    description:
      Must be defined if the cros-ec is a rpmsg device for a Mediatek
      ARM Cortex M4 Co-processor. Contains the name pf the rpmsg
      device. Used to match the subnode to the rpmsg device announced by
      the SCP.
    $ref: "/schemas/types.yaml#/definitions/string"

  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.

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  typec:
    $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"

  ec-pwm:
    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"

  keyboard-controller:
    $ref: "/schemas/input/google,cros-ec-keyb.yaml#"

  proximity:
    $ref: "/schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#"

  codecs:
    type: object
    additionalProperties: false

    properties:
      '#address-cells':
        const: 2

      '#size-cells':
        const: 1

    patternProperties:
      "^ec-codec@[a-f0-9]+$":
        type: object
        $ref: "/schemas/sound/google,cros-ec-codec.yaml#"

    required:
      - "#address-cells"
      - "#size-cells"

  cbas:
    type: object

    description:
      This device is used to signal when a detachable base is attached
      to a Chrome OS tablet. This device cannot be detected at runtime.

    properties:
      compatible:
        const: google,cros-cbas

    required:
      - compatible

    additionalProperties: false

patternProperties:
  "^i2c-tunnel[0-9]*$":
    type: object
    $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"

  "^regulator@[0-9]+$":
    type: object
    $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"

  "^extcon[0-9]*$":
    type: object
    $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"

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>;

            proximity {
                    compatible = "google,cros-ec-mkbp-proximity";
            };

            cbas {
                compatible = "google,cros-cbas";
            };
        };
    };

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