Skip to content

Commit 1acd457

Browse files
Ricardo Cañuelorobherring
authored andcommitted
dt-bindings: i2c: convert i2c-cros-ec-tunnel to json-schema
Convert the google,cros-ec-i2c-tunnel binding to YAML and add it as a property of google,cros-ec.yaml. Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Link: https://lore.kernel.org/r/20201021114308.25485-2-ricardo.canuelo@collabora.com [robh: add ref to i2c-controller.yaml] Signed-off-by: Rob Herring <robh@kernel.org>
1 parent ca05f33 commit 1acd457

3 files changed

Lines changed: 71 additions & 39 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
5+
$id: http://devicetree.org/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: I2C bus that tunnels through the ChromeOS EC (cros-ec)
9+
10+
maintainers:
11+
- Doug Anderson <dianders@chromium.org>
12+
- Benson Leung <bleung@chromium.org>
13+
- Enric Balletbo i Serra <enric.balletbo@collabora.com>
14+
15+
description: |
16+
On some ChromeOS board designs we've got a connection to the EC
17+
(embedded controller) but no direct connection to some devices on the
18+
other side of the EC (like a battery and PMIC). To get access to
19+
those devices we need to tunnel our i2c commands through the EC.
20+
21+
The node for this device should be under a cros-ec node like
22+
google,cros-ec-spi or google,cros-ec-i2c.
23+
24+
allOf:
25+
- $ref: i2c-controller.yaml#
26+
27+
properties:
28+
compatible:
29+
const: google,cros-ec-i2c-tunnel
30+
31+
google,remote-bus:
32+
description: The EC bus we'd like to talk to.
33+
$ref: /schemas/types.yaml#/definitions/uint32
34+
35+
required:
36+
- compatible
37+
- google,remote-bus
38+
39+
unevaluatedProperties: false
40+
41+
examples:
42+
- |
43+
spi0 {
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
47+
cros-ec@0 {
48+
compatible = "google,cros-ec-spi";
49+
reg = <0>;
50+
spi-max-frequency = <5000000>;
51+
52+
i2c-tunnel {
53+
compatible = "google,cros-ec-i2c-tunnel";
54+
#address-cells = <1>;
55+
#size-cells = <0>;
56+
57+
google,remote-bus = <0>;
58+
59+
battery: sbs-battery@b {
60+
compatible = "sbs,sbs-battery";
61+
reg = <0xb>;
62+
sbs,poll-retry-count = <1>;
63+
};
64+
};
65+
};
66+
};

Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt

Lines changed: 0 additions & 39 deletions
This file was deleted.

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ properties:
7171
wakeup-source:
7272
description: Button can wake-up the system.
7373

74+
patternProperties:
75+
"^i2c-tunnel[0-9]*$":
76+
type: object
77+
$ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
78+
7479
required:
7580
- compatible
7681

0 commit comments

Comments
 (0)