* [PATCH i2c-next v4 1/1] dt-bindings: i2c: mellanox,i2c-mlxbf: convert txt to YAML schema
@ 2020-11-20 23:06 Khalil Blaiech
2020-12-02 15:29 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Khalil Blaiech @ 2020-11-20 23:06 UTC (permalink / raw)
To: linux-i2c, devicetree; +Cc: kblaiech, wsa+renesas, robh+dt
Write the devicetree binding text file associated with
the Mellanox BlueField I2C controller in schema file,
JSON compatible subset of YAML. Besides, add an entry
within MAINTAINERS file.
Signed-off-by: Khalil Blaiech <kblaiech@nvidia.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
v3->v4:
- Add Reviewed-by tag.
v2->v3:
- Address dtschema/dt warning/errors by removing
'additionalProperties: false' line.
v1->v2:
- Address yamllint and dtschema/dt warning/errors.
- Dual license the YAML schema by adding BSD-2-Clause.
.../devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt | 42 ------------
.../bindings/i2c/mellanox,i2c-mlxbf.yaml | 78 ++++++++++++++++++++++
MAINTAINERS | 1 +
3 files changed, 79 insertions(+), 42 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt
create mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt
deleted file mode 100644
index 566ea86..0000000
--- a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-Device tree configuration for the Mellanox I2C SMBus on BlueField SoCs
-
-Required Properties:
-
-- compatible : should be "mellanox,i2c-mlxbf1" or "mellanox,i2c-mlxbf2".
-
-- reg : address offset and length of the device registers. The
- registers consist of the following set of resources:
- 1) Smbus block registers.
- 2) Cause master registers.
- 3) Cause slave registers.
- 4) Cause coalesce registers (if compatible isn't set
- to "mellanox,i2c-mlxbf1").
-
-- interrupts : interrupt number.
-
-Optional Properties:
-
-- clock-frequency : bus frequency used to configure timing registers;
- allowed values are 100000, 400000 and 1000000;
- those are expressed in Hz. Default is 100000.
-
-Example:
-
-i2c@2804000 {
- compatible = "mellanox,i2c-mlxbf1";
- reg = <0x02804000 0x800>,
- <0x02801200 0x020>,
- <0x02801260 0x020>;
- interrupts = <57>;
- clock-frequency = <100000>;
-};
-
-i2c@2808800 {
- compatible = "mellanox,i2c-mlxbf2";
- reg = <0x02808800 0x600>,
- <0x02808e00 0x020>,
- <0x02808e20 0x020>,
- <0x02808e40 0x010>;
- interrupts = <57>;
- clock-frequency = <400000>;
-};
diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
new file mode 100644
index 0000000..d2b401d
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/mellanox,i2c-mlxbf.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mellanox I2C SMBus on BlueField SoCs
+
+maintainers:
+ - Khalil Blaiech <kblaiech@nvidia.com>
+
+allOf:
+ - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+ compatible:
+ enum:
+ - mellanox,i2c-mlxbf1
+ - mellanox,i2c-mlxbf2
+
+ reg:
+ minItems: 3
+ maxItems: 4
+ items:
+ - description: Smbus block registers
+ - description: Cause master registers
+ - description: Cause slave registers
+ - description: Cause coalesce registers
+
+ interrupts:
+ maxItems: 1
+
+ clock-frequency:
+ enum: [ 100000, 400000, 1000000 ]
+ description:
+ bus frequency used to configure timing registers;
+ The frequency is expressed in Hz. Default is 100000.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+unevaluatedProperties: false
+
+if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mellanox,i2c-mlxbf1
+
+then:
+ properties:
+ reg:
+ maxItems: 3
+
+examples:
+ - |
+ i2c@2804000 {
+ compatible = "mellanox,i2c-mlxbf1";
+ reg = <0x02804000 0x800>,
+ <0x02801200 0x020>,
+ <0x02801260 0x020>;
+ interrupts = <57>;
+ clock-frequency = <100000>;
+ };
+
+ - |
+ i2c@2808800 {
+ compatible = "mellanox,i2c-mlxbf2";
+ reg = <0x02808800 0x600>,
+ <0x02808e00 0x020>,
+ <0x02808e20 0x020>,
+ <0x02808e40 0x010>;
+ interrupts = <57>;
+ clock-frequency = <400000>;
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index a008b70..27bd55b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11151,6 +11151,7 @@ MELLANOX BLUEFIELD I2C DRIVER
M: Khalil Blaiech <kblaiech@nvidia.com>
L: linux-i2c@vger.kernel.org
S: Supported
+F: Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
F: drivers/i2c/busses/i2c-mlxbf.c
MELLANOX ETHERNET DRIVER (mlx4_en)
--
2.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH i2c-next v4 1/1] dt-bindings: i2c: mellanox,i2c-mlxbf: convert txt to YAML schema
2020-11-20 23:06 [PATCH i2c-next v4 1/1] dt-bindings: i2c: mellanox,i2c-mlxbf: convert txt to YAML schema Khalil Blaiech
@ 2020-12-02 15:29 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2020-12-02 15:29 UTC (permalink / raw)
To: Khalil Blaiech; +Cc: linux-i2c, devicetree, robh+dt
[-- Attachment #1: Type: text/plain, Size: 404 bytes --]
On Fri, Nov 20, 2020 at 06:06:06PM -0500, Khalil Blaiech wrote:
> Write the devicetree binding text file associated with
> the Mellanox BlueField I2C controller in schema file,
> JSON compatible subset of YAML. Besides, add an entry
> within MAINTAINERS file.
>
> Signed-off-by: Khalil Blaiech <kblaiech@nvidia.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-02 15:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 23:06 [PATCH i2c-next v4 1/1] dt-bindings: i2c: mellanox,i2c-mlxbf: convert txt to YAML schema Khalil Blaiech
2020-12-02 15:29 ` Wolfram Sang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.