]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dt-bindings: i2c: i2c-fsi: Convert to json-schema
authorEddie James <eajames@linux.ibm.com>
Wed, 22 May 2024 19:25:15 +0000 (14:25 -0500)
committerRob Herring (Arm) <robh@kernel.org>
Tue, 9 Jul 2024 13:40:17 +0000 (07:40 -0600)
Convert to json-schema for the FSI-attached I2C controller.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Ninad Palsule <ninad@linux.ibm.com>
Link: https://lore.kernel.org/r/20240522192524.3286237-12-eajames@linux.ibm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Documentation/devicetree/bindings/i2c/i2c-fsi.txt [deleted file]
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml [new file with mode: 0644]
MAINTAINERS

diff --git a/Documentation/devicetree/bindings/i2c/i2c-fsi.txt b/Documentation/devicetree/bindings/i2c/i2c-fsi.txt
deleted file mode 100644 (file)
index b1be2ce..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-Device-tree bindings for FSI-attached I2C master and busses
------------------------------------------------------------
-
-Required properties:
- - compatible = "ibm,i2c-fsi";
- - reg = < address size >;             : The FSI CFAM address and address
-                                         space size.
- - #address-cells = <1>;               : Number of address cells in child
-                                         nodes.
- - #size-cells = <0>;                  : Number of size cells in child nodes.
- - child nodes                         : Nodes to describe busses off the I2C
-                                         master.
-
-Child node required properties:
- - reg = < port number >               : The port number on the I2C master.
-
-Child node optional properties:
- - child nodes                         : Nodes to describe devices on the I2C
-                                         bus.
-
-Examples:
-
-    i2c@1800 {
-        compatible = "ibm,i2c-fsi";
-        reg = < 0x1800 0x400 >;
-        #address-cells = <1>;
-        #size-cells = <0>;
-
-        i2c-bus@0 {
-            reg = <0>;
-        };
-
-        i2c-bus@1 {
-            reg = <1>;
-
-            eeprom@50 {
-                compatible = "vendor,dev-name";
-            };
-        };
-    };
diff --git a/Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml b/Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml
new file mode 100644 (file)
index 0000000..40ea829
--- /dev/null
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/ibm,i2c-fsi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IBM FSI-attached I2C controller
+
+maintainers:
+  - Eddie James <eajames@linux.ibm.com>
+
+description:
+  This I2C controller is an FSI CFAM engine, providing access to a number of
+  I2C busses. Therefore this node will always be a child of an FSI CFAM node.
+
+properties:
+  compatible:
+    enum:
+      - ibm,i2c-fsi
+
+  reg:
+    items:
+      - description: FSI slave address
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^i2c-bus@[0-9a-f]+$":
+    type: object
+    properties:
+      reg:
+        maxItems: 1
+
+    required:
+      - reg
+
+    allOf:
+      - $ref: /schemas/i2c/i2c-controller.yaml#
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c@1800 {
+        compatible = "ibm,i2c-fsi";
+        reg = <0x1800 0x400>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c-bus@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+
+        i2c-bus@1 {
+            reg = <1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            eeprom@50 {
+                compatible = "atmel,24c64";
+                reg = <0x50>;
+            };
+        };
+    };
index d6c90161c7bfe3886e675396cb2d2d7b44acc3b3..b32c391f1b6dcef3853684be5e76a49b0d8ff5e7 100644 (file)
@@ -8976,7 +8976,7 @@ M:        Eddie James <eajames@linux.ibm.com>
 L:     linux-i2c@vger.kernel.org
 L:     openbmc@lists.ozlabs.org (moderated for non-subscribers)
 S:     Maintained
-F:     Documentation/devicetree/bindings/i2c/i2c-fsi.txt
+F:     Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml
 F:     drivers/i2c/busses/i2c-fsi.c
 
 FSI-ATTACHED SPI DRIVER