-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dt-bindings: mfd: Convert ChromeOS EC bindings to json-schema
Convert the ChromeOS EC bindings to json-schema. Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
- Loading branch information
Ikjoon Jang
authored and
Lee Jones
committed
Jul 14, 2020
1 parent
21b2998
commit 46b5780
Showing
2 changed files
with
129 additions
and
76 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
129 changes: 129 additions & 0 deletions
129
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# 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 | ||
|
||
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 | ||
|
||
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"; | ||
}; | ||
}; | ||
... |