Skip to contentSkip to conversation

dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml

PATCH Superseded Dafna Hirschfeld 2 participants 4 messages Feb 13, 2020

Subsystems (4)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml

Convert the binding file i2c-cros-ec-tunnel.txt to yaml format.

This was tested and verified on ARM and ARM64 with:

make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml

---
Changes since v1:
- changing the subject to start with "dt-bindings: i2c: cros-ec-tunnel:"
- changing the license to (GPL-2.0-only OR BSD-2-Clause)
- removing "Guenter Roeck <[email protected]>" from the maintainers list
- adding ref: /schemas/i2c/i2c-controller.yaml

Changes since v2:
- adding another patch that fixes a warning found by this patch

 .../bindings/i2c/i2c-cros-ec-tunnel.txt       | 39 ------------
 .../bindings/i2c/i2c-cros-ec-tunnel.yaml      | 63 +++++++++++++++++++
 2 files changed, 63 insertions(+), 39 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml
Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt deleted +0 -39
deleted file mode 100644
index 898f030eba62..000000000000
@@ -1,39 +0,0 @@
-I2C bus that tunnels through the ChromeOS EC (cros-ec)
-======================================================
-On some ChromeOS board designs we've got a connection to the EC (embedded
-controller) but no direct connection to some devices on the other side of
-the EC (like a battery and PMIC).  To get access to those devices we need
-to tunnel our i2c commands through the EC.
-
-The node for this device should be under a cros-ec node like google,cros-ec-spi
-or google,cros-ec-i2c.
-
-
-Required properties:
-- compatible: google,cros-ec-i2c-tunnel
-- google,remote-bus: The EC bus we'd like to talk to.
-
-Optional child nodes:
-- One node per I2C device connected to the tunnelled I2C bus.
-
-
-Example:
-	cros-ec@0 {
-		compatible = "google,cros-ec-spi";
-
-		...
-
-		i2c-tunnel {
-			compatible = "google,cros-ec-i2c-tunnel";
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			google,remote-bus = <0>;
-
-			battery: sbs-battery@b {
-				compatible = "sbs,sbs-battery";
-				reg = <0xb>;
-				sbs,poll-retry-count = <1>;
-			};
-		};
-	}
Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml new file +63 -0

63 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 2/2 arm64: tegra: add unit address to nodes under i2c-tunnel

add unit address to the nodes bq24735, smart-battery

This fixes the warning:
'bq24735', 'smart-battery' do not match any of the
regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'

---
 arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +2 -2
index a0385a386a3f..a19171f6f0f7 100644
@@ -767,7 +767,7 @@
 
 				google,remote-bus = <0>;
 
-				charger: bq24735 {
+				charger: bq24735@9 {
 					compatible = "ti,bq24735";
 					reg = <0x9>;
 					interrupt-parent = <&gpio>;
@@ -778,7 +778,7 @@
 							GPIO_ACTIVE_HIGH>;
 				};
 
-				battery: smart-battery {
+				battery: smart-battery@b {
 					compatible = "sbs,sbs-battery";
 					reg = <0xb>;
 					battery-name = "battery";
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel

Hi,

Quoted 8 lines · Dafna Hirschfeld

add unit address to the nodes bq24735, smart-battery

This fixes the warning:
'bq24735', 'smart-battery' do not match any of the
regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'

---

While fixing the node names, it makes sense to also use device class instead of name as mentioned in Documentation/devicetree/bindings/writing-bindings.txt

arch/arm64/boot/dts/nvidia/tegra132-norrin.dts line 770

Quoted 13 lines
 arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +1 -1
index a0385a386a3f..a19171f6f0f7 100644
@@ -767,7 +767,7 @@
 
 				google,remote-bus = <0>;
 
-				charger: bq24735 {
+				charger: bq24735@9 {

charger: charger@9 {

arch/arm64/boot/dts/nvidia/tegra132-norrin.dts line 781

Quoted 9 lines
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +1 -1
 					compatible = "ti,bq24735";
 					reg = <0x9>;
 					interrupt-parent = <&gpio>;
@@ -778,7 +778,7 @@
 							GPIO_ACTIVE_HIGH>;
 				};
 
-				battery: smart-battery {
+				battery: smart-battery@b {

battery: battery@b {

arch/arm64/boot/dts/nvidia/tegra132-norrin.dts line 784

Quoted 3 lines
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +0 -0
 					compatible = "sbs,sbs-battery";
 					reg = <0xb>;
 					battery-name = "battery";

-- Sebastian

#3 lore raw
In reply to Dafna Hirschfeld

Hi,

Quoted 9 lines · Dafna Hirschfeld

Convert the binding file i2c-cros-ec-tunnel.txt to yaml format.

This was tested and verified on ARM and ARM64 with:

make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml

---

[...]

Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml line 57

Quoted 11 lines
Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml new file +11 -0
+examples:
+  - |
+    cros-ec@0 {
+        compatible = "google,cros-ec-spi";
+        i2c-tunnel {
+            compatible = "google,cros-ec-i2c-tunnel";
+            #address-cells = <1>;
+            #size-cells = <0>;
+            google,remote-bus = <0>;
+
+            battery: sbs-battery@b {

This should be "battery@b {", since node names are supposed to match the class of the device instead of the name of the device.

Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml line 63

Quoted 6 lines
Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml new file +6 -0
+                compatible = "sbs,sbs-battery";
+                reg = <0xb>;
+                sbs,poll-retry-count = <1>;
+            };
+        };
+    };

-- Sebastian