Skip to contentSkip to conversation

dt-bindings: i2c: tegra: Convert to json-schema

PATCH Applied Thierry Reding 2 participants 8 messages Dec 17, 2021

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 dt-bindings: i2c: tegra: Convert to json-schema

From: Thierry Reding <[email protected]>

Convert the Tegra I2C controller bindings from plain text to json-schema format.

---
Changes in v2:
- include i2c-controller.yaml and use unevaluatedProperties: false

 .../bindings/i2c/nvidia,tegra20-i2c.txt       |  87 --------
 .../bindings/i2c/nvidia,tegra20-i2c.yaml      | 192 ++++++++++++++++++
 2 files changed, 192 insertions(+), 87 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml
Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt deleted +0 -87
deleted file mode 100644
index 3f2f990c2e62..000000000000
@@ -1,87 +0,0 @@
-NVIDIA Tegra20/Tegra30/Tegra114 I2C controller driver.
-
-Required properties:
-- compatible : For Tegra20, must be one of "nvidia,tegra20-i2c-dvc" or
-  "nvidia,tegra20-i2c".  For Tegra30, must be "nvidia,tegra30-i2c".
-  For Tegra114, must be "nvidia,tegra114-i2c".  Otherwise, must be
-  "nvidia,<chip>-i2c", plus at least one of the above, where <chip> is
-  tegra124, tegra132, or tegra210.
-  Details of compatible are as follows:
-  nvidia,tegra20-i2c-dvc: Tegra20 has specific I2C controller called as DVC I2C
-	controller. This only support master mode of I2C communication. Register
-	interface/offset and interrupts handling are different than generic I2C
-	controller. Driver of DVC I2C controller is only compatible with
-	"nvidia,tegra20-i2c-dvc".
-  nvidia,tegra20-i2c: Tegra20 has 4 generic I2C controller. This can support
-	master and slave mode of I2C communication. The i2c-tegra driver only
-	support master mode of I2C communication. Driver of I2C controller is
-	only compatible with "nvidia,tegra20-i2c".
-  nvidia,tegra30-i2c: Tegra30 has 5 generic I2C controller. This controller is
-	very much similar to Tegra20 I2C controller with additional feature:
-	Continue Transfer Support. This feature helps to implement M_NO_START
-	as per I2C core API transfer flags. Driver of I2C controller is
-	compatible with "nvidia,tegra30-i2c" to enable the continue transfer
-	support. This is also compatible with "nvidia,tegra20-i2c" without
-	continue transfer support.
-  nvidia,tegra114-i2c: Tegra114 has 5 generic I2C controller. This controller is
-	very much similar to Tegra30 I2C controller with some hardware
-	modification:
-	 - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk and
-	   fast-clk. Tegra114 has only one clock source called as div-clk and
-	   hence clock mechanism is changed in I2C controller.
-	 - Tegra30/Tegra20 I2C controller has enabled per packet transfer by
-	   default and there is no way to disable it. Tegra114 has this
-	   interrupt disable by default and SW need to enable explicitly.
-	Due to above changes, Tegra114 I2C driver makes incompatible with
-	previous hardware driver. Hence, tegra114 I2C controller is compatible
-	with "nvidia,tegra114-i2c".
-  nvidia,tegra210-i2c-vi: Tegra210 has one I2C controller that is on host1x bus
-	and is part of VE power domain and typically used for camera use-cases.
-	This VI I2C controller is mostly compatible with the programming model
-	of the regular I2C controllers with a few exceptions. The I2C registers
-	start at an offset of 0xc00 (instead of 0), registers are 16 bytes
-	apart (rather than 4) and the controller does not support slave mode.
-- reg: Should contain I2C controller registers physical address and length.
-- interrupts: Should contain I2C controller interrupts.
-- address-cells: Address cells for I2C device address.
-- size-cells: Size of the I2C device address.
-- clocks: Must contain an entry for each entry in clock-names.
-  See ../clocks/clock-bindings.txt for details.
-- clock-names: Must include the following entries:
-  Tegra20/Tegra30:
-  - div-clk
-  - fast-clk
-  Tegra114:
-  - div-clk
-  Tegra210:
-  - div-clk
-  - slow (only for nvidia,tegra210-i2c-vi compatible node)
-- resets: Must contain an entry for each entry in reset-names.
-  See ../reset/reset.txt for details.
-- reset-names: Must include the following entries:
-  - i2c
-- power-domains: Only for nvidia,tegra210-i2c-vi compatible node and must
-  include venc powergate node as vi i2c is part of VE power domain.
-  tegra210-i2c-vi:
-  - pd_venc
-- dmas: Must contain an entry for each entry in clock-names.
-  See ../dma/dma.txt for details.
-- dma-names: Must include the following entries:
-  - rx
-  - tx
-
-Example:
-
-	i2c@7000c000 {
-		compatible = "nvidia,tegra20-i2c";
-		reg = <0x7000c000 0x100>;
-		interrupts = <0 38 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&tegra_car 12>, <&tegra_car 124>;
-		clock-names = "div-clk", "fast-clk";
-		resets = <&tegra_car 12>;
-		reset-names = "i2c";
-		dmas = <&apbdma 16>, <&apbdma 16>;
-		dma-names = "rx", "tx";
-	};
Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml new file +192 -0

192 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/4 dt-bindings: i2c: i2c-mux-pinctrl: Convert to json-schema

From: Thierry Reding <[email protected]>

Convert the pinctrl-based I2C mux bindings from the free-form text format to json-schema.

---
 .../bindings/i2c/i2c-mux-pinctrl.txt          |  93 ----------------
 .../bindings/i2c/i2c-mux-pinctrl.yaml         | 103 ++++++++++++++++++
 2 files changed, 103 insertions(+), 93 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml
Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt deleted +0 -93
deleted file mode 100644
index 997a287ed3f6..000000000000
@@ -1,93 +0,0 @@
-Pinctrl-based I2C Bus Mux
-
-This binding describes an I2C bus multiplexer that uses pin multiplexing to
-route the I2C signals, and represents the pin multiplexing configuration
-using the pinctrl device tree bindings.
-
-                                 +-----+  +-----+
-                                 | dev |  | dev |
-    +------------------------+   +-----+  +-----+
-    | SoC                    |      |        |
-    |                   /----|------+--------+
-    |   +---+   +------+     | child bus A, on first set of pins
-    |   |I2C|---|Pinmux|     |
-    |   +---+   +------+     | child bus B, on second set of pins
-    |                   \----|------+--------+--------+
-    |                        |      |        |        |
-    +------------------------+  +-----+  +-----+  +-----+
-                                | dev |  | dev |  | dev |
-                                +-----+  +-----+  +-----+
-
-Required properties:
-- compatible: i2c-mux-pinctrl
-- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
-  port is connected to.
-
-Also required are:
-
-* Standard pinctrl properties that specify the pin mux state for each child
-  bus. See ../pinctrl/pinctrl-bindings.txt.
-
-* Standard I2C mux properties. See i2c-mux.yaml in this directory.
-
-* I2C child bus nodes. See i2c-mux.yaml in this directory.
-
-For each named state defined in the pinctrl-names property, an I2C child bus
-will be created. I2C child bus numbers are assigned based on the index into
-the pinctrl-names property.
-
-The only exception is that no bus will be created for a state named "idle". If
-such a state is defined, it must be the last entry in pinctrl-names. For
-example:
-
-	pinctrl-names = "ddc", "pta", "idle"  ->  ddc = bus 0, pta = bus 1
-	pinctrl-names = "ddc", "idle", "pta"  ->  Invalid ("idle" not last)
-	pinctrl-names = "idle", "ddc", "pta"  ->  Invalid ("idle" not last)
-
-Whenever an access is made to a device on a child bus, the relevant pinctrl
-state will be programmed into hardware.
-
-If an idle state is defined, whenever an access is not being made to a device
-on a child bus, the idle pinctrl state will be programmed into hardware.
-
-If an idle state is not defined, the most recently used pinctrl state will be
-left programmed into hardware whenever no access is being made of a device on
-a child bus.
-
-Example:
-
-	i2cmux {
-		compatible = "i2c-mux-pinctrl";
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		i2c-parent = <&i2c1>;
-
-		pinctrl-names = "ddc", "pta", "idle";
-		pinctrl-0 = <&state_i2cmux_ddc>;
-		pinctrl-1 = <&state_i2cmux_pta>;
-		pinctrl-2 = <&state_i2cmux_idle>;
-
-		i2c@0 {
-			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			eeprom {
-				compatible = "eeprom";
-				reg = <0x50>;
-			};
-		};
-
-		i2c@1 {
-			reg = <1>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			eeprom {
-				compatible = "eeprom";
-				reg = <0x50>;
-			};
-		};
-	};
-
Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw

Re: [PATCH 2/4] dt-bindings: i2c: i2c-mux-pinctrl: Convert to json-schema

Quoted 5 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Convert the pinctrl-based I2C mux bindings from the free-form text format to json-schema.

Quoted 8 lines
---
 .../bindings/i2c/i2c-mux-pinctrl.txt          |  93 ----------------
 .../bindings/i2c/i2c-mux-pinctrl.yaml         | 103 ++++++++++++++++++
 2 files changed, 103 insertions(+), 93 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.yaml

Applied, thanks!

#3 lore raw

PATCH 3/4 dt-bindings: i2c: aspeed: Document interrupt controller properties

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Document the interrupt-controller and #interrupt-cells properties that are used by some instances of the aspeed-i2c device tree nodes.

---
 Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml +6 -0
index f597f73ccd87..2a74551c72c0 100644
@@ -28,6 +28,12 @@ properties:
   interrupts:
     maxItems: 1
 
+  interrupt-controller:
+    description: marks this device as being an interrupt provider
+
+  "#interrupt-cells":
+    const: 1
+
   clocks:
     maxItems: 1
     description:
Signature · 1 line
2.34.1
maintainer
#4 lore raw

Re: [PATCH 3/4] dt-bindings: i2c: aspeed: Document interrupt controller properties

Quoted 4 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Document the interrupt-controller and #interrupt-cells properties that are used by some instances of the aspeed-i2c device tree nodes.

I though you agreed with my patch removing "#interrupt-cells"? I thought the interrupt part was split to another node "aspeed,ast2500-i2c-ic".

Quoted 26 lines
---
 Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml +6 -0
index f597f73ccd87..2a74551c72c0 100644
@@ -28,6 +28,12 @@ properties:
   interrupts:
     maxItems: 1
 
+  interrupt-controller:
+    description: marks this device as being an interrupt provider
+
+  "#interrupt-cells":
+    const: 1
+
   clocks:
     maxItems: 1
     description:
Signature · 1 line
2.34.1
#5 lore raw

PATCH 4/4 dt-bindings: i2c: i2c-mux-gpio: Convert to json-schema

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Convert the GPIO-based I2C mux bindings from the free-form text format to json-schema.

---
 .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |  80 --------------
 .../devicetree/bindings/i2c/i2c-mux-gpio.yaml | 103 ++++++++++++++++++
 2 files changed, 103 insertions(+), 80 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt deleted +0 -80
deleted file mode 100644
index d4cf10582a26..000000000000
@@ -1,80 +0,0 @@
-GPIO-based I2C Bus Mux
-
-This binding describes an I2C bus multiplexer that uses GPIOs to
-route the I2C signals.
-
-                                  +-----+  +-----+
-                                  | dev |  | dev |
-    +------------+                +-----+  +-----+
-    | SoC        |                   |        |
-    |            |          /--------+--------+
-    |   +------+ |  +------+    child bus A, on GPIO value set to 0
-    |   | I2C  |-|--| Mux  |
-    |   +------+ |  +--+---+    child bus B, on GPIO value set to 1
-    |            |     |    \----------+--------+--------+
-    |   +------+ |     |               |        |        |
-    |   | GPIO |-|-----+            +-----+  +-----+  +-----+
-    |   +------+ |                  | dev |  | dev |  | dev |
-    +------------+                  +-----+  +-----+  +-----+
-
-Required properties:
-- compatible: i2c-mux-gpio
-- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
-  port is connected to.
-- mux-gpios: list of gpios used to control the muxer
-* Standard I2C mux properties. See i2c-mux.yaml in this directory.
-* I2C child bus nodes. See i2c-mux.yaml in this directory.
-
-Optional properties:
-- idle-state: value to set the muxer to when idle. When no value is
-  given, it defaults to the last value used.
-
-For each i2c child node, an I2C child bus will be created. They will
-be numbered based on their order in the device tree.
-
-Whenever an access is made to a device on a child bus, the value set
-in the relevant node's reg property will be output using the list of
-GPIOs, the first in the list holding the least-significant value.
-
-If an idle state is defined, using the idle-state (optional) property,
-whenever an access is not being made to a device on a child bus, the
-GPIOs will be set according to the idle value.
-
-If an idle state is not defined, the most recently used value will be
-left programmed into hardware whenever no access is being made to a
-device on a child bus.
-
-Example:
-	i2cmux {
-		compatible = "i2c-mux-gpio";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
-		i2c-parent = <&i2c1>;
-
-		i2c@1 {
-			reg = <1>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			ssd1307: oled@3c {
-				compatible = "solomon,ssd1307fb-i2c";
-				reg = <0x3c>;
-				pwms = <&pwm 4 3000>;
-				reset-gpios = <&gpio2 7 1>;
-			};
-		};
-
-		i2c@3 {
-			reg = <3>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			pca9555: pca9555@20 {
-				compatible = "nxp,pca9555";
-				gpio-controller;
-				#gpio-cells = <2>;
-				reg = <0x20>;
-			};
-		};
-	};
Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer Applied
#6 lore raw

Re: [PATCH 4/4] dt-bindings: i2c: i2c-mux-gpio: Convert to json-schema

Quoted 5 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Convert the GPIO-based I2C mux bindings from the free-form text format to json-schema.

Quoted 8 lines
---
 .../devicetree/bindings/i2c/i2c-mux-gpio.txt  |  80 --------------
 .../devicetree/bindings/i2c/i2c-mux-gpio.yaml | 103 ++++++++++++++++++
 2 files changed, 103 insertions(+), 80 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml

Applied, thanks!

maintainer Applied
#7 lore raw
In reply to Thierry Reding
Quoted 10 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Convert the Tegra I2C controller bindings from plain text to json-schema format.

---
Changes in v2:
- include i2c-controller.yaml and use unevaluatedProperties: false

Quoted 6 lines
 .../bindings/i2c/nvidia,tegra20-i2c.txt       |  87 --------
 .../bindings/i2c/nvidia,tegra20-i2c.yaml      | 192 ++++++++++++++++++
 2 files changed, 192 insertions(+), 87 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml

Applied, thanks!