linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml
@ 2020-02-13 21:46 Dafna Hirschfeld
  2020-02-13 21:46 ` [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel Dafna Hirschfeld
  2020-02-13 22:35 ` [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Sebastian Reichel
  0 siblings, 2 replies; 4+ messages in thread
From: Dafna Hirschfeld @ 2020-02-13 21:46 UTC (permalink / raw)
  To: linux-i2c
  Cc: robh+dt, mark.rutland, bleung, enric.balletbo, groeck,
	dafna.hirschfeld, devicetree, linux-kernel, helen.koike,
	ezequiel, kernel, dafna3

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

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
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 <groeck@chromium.org>" 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

diff --git a/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt b/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt
deleted file mode 100644
index 898f030eba62..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.txt
+++ /dev/null
@@ -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>;
-			};
-		};
-	}
diff --git a/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml b/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml
new file mode 100644
index 000000000000..a14d821ff65d
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-cros-ec-tunnel.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-cros-ec-tunnel.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: I2C bus that tunnels through the ChromeOS EC (cros-ec)
+
+maintainers:
+  - Benson Leung <bleung@chromium.org>
+  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
+
+description: |
+  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.
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    const:
+      google,cros-ec-i2c-tunnel
+
+  google,remote-bus:
+    $ref: "/schemas/types.yaml#/definitions/uint32"
+    description: The EC bus we'd like to talk to.
+
+  "#address-cells": true
+  "#size-cells": true
+
+patternProperties:
+  "^.*@[0-9a-f]+$":
+    type: object
+    description: One node per I2C device connected to the tunnelled I2C bus.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - google,remote-bus
+
+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 {
+                compatible = "sbs,sbs-battery";
+                reg = <0xb>;
+                sbs,poll-retry-count = <1>;
+            };
+        };
+    };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel
  2020-02-13 21:46 [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Dafna Hirschfeld
@ 2020-02-13 21:46 ` Dafna Hirschfeld
  2020-02-13 22:33   ` Sebastian Reichel
  2020-02-13 22:35 ` [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Sebastian Reichel
  1 sibling, 1 reply; 4+ messages in thread
From: Dafna Hirschfeld @ 2020-02-13 21:46 UTC (permalink / raw)
  To: linux-i2c
  Cc: robh+dt, mark.rutland, bleung, enric.balletbo, groeck,
	dafna.hirschfeld, devicetree, linux-kernel, helen.koike,
	ezequiel, kernel, dafna3

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]+'

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
index a0385a386a3f..a19171f6f0f7 100644
--- a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
@@ -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";
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel
  2020-02-13 21:46 ` [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel Dafna Hirschfeld
@ 2020-02-13 22:33   ` Sebastian Reichel
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2020-02-13 22:33 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: linux-i2c, robh+dt, mark.rutland, bleung, enric.balletbo, groeck,
	devicetree, linux-kernel, helen.koike, ezequiel, kernel, dafna3

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

Hi,

On Thu, Feb 13, 2020 at 10:46:56PM +0100, Dafna Hirschfeld wrote:
> 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]+'
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---

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

charger: charger@9 {

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

>  					compatible = "sbs,sbs-battery";
>  					reg = <0xb>;
>  					battery-name = "battery";

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml
  2020-02-13 21:46 [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Dafna Hirschfeld
  2020-02-13 21:46 ` [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel Dafna Hirschfeld
@ 2020-02-13 22:35 ` Sebastian Reichel
  1 sibling, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2020-02-13 22:35 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: linux-i2c, robh+dt, mark.rutland, bleung, enric.balletbo, groeck,
	devicetree, linux-kernel, helen.koike, ezequiel, kernel, dafna3

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

Hi,

On Thu, Feb 13, 2020 at 10:46:55PM +0100, Dafna Hirschfeld wrote:
> 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
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---

[...]

> +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.

> +                compatible = "sbs,sbs-battery";
> +                reg = <0xb>;
> +                sbs,poll-retry-count = <1>;
> +            };
> +        };
> +    };

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-13 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 21:46 [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Dafna Hirschfeld
2020-02-13 21:46 ` [PATCH v3 2/2] arm64: tegra: add unit address to nodes under i2c-tunnel Dafna Hirschfeld
2020-02-13 22:33   ` Sebastian Reichel
2020-02-13 22:35 ` [PATCH v3 1/2] dt-bindings: i2c: cros-ec-tunnel: convert i2c-cros-ec-tunnel.txt to yaml Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).