diff mbox series

dt-bindings: nxp,i2c-pnx: Convert to dtschema

Message ID 20240318091911.13426-1-animeshagarwal28@gmail.com
State Superseded
Headers show
Series dt-bindings: nxp,i2c-pnx: Convert to dtschema | expand

Commit Message

Animesh Agarwal March 18, 2024, 9:19 a.m. UTC
Convert the NXP PNX I2C Controller bindings to DT schema.
Keep only one example in DT schema to remove redundancy.

Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
---
 .../devicetree/bindings/i2c/i2c-pnx.txt       | 34 ------------
 .../devicetree/bindings/i2c/nxp,i2c-pnx.yaml  | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-pnx.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml

Comments

Rob Herring March 18, 2024, 2:23 p.m. UTC | #1
On Mon, Mar 18, 2024 at 02:49:05PM +0530, Animesh Agarwal wrote:
> Convert the NXP PNX I2C Controller bindings to DT schema.
> Keep only one example in DT schema to remove redundancy.
> 
> Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
> ---
>  .../devicetree/bindings/i2c/i2c-pnx.txt       | 34 ------------
>  .../devicetree/bindings/i2c/nxp,i2c-pnx.yaml  | 52 +++++++++++++++++++
>  2 files changed, 52 insertions(+), 34 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-pnx.txt
>  create mode 100644 Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml

> diff --git a/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml b/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml
> new file mode 100644
> index 000000000000..b44e4f995b73
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml

Doesn't quite match the compatible string.

> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/nxp,i2c-pnx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP PNX I2C Controller
> +
> +maintainers:
> +  - Animesh Agarwal<animeshagarwal28@gmail.com>
> +
> +allOf:
> +  - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> +properties:
> +  compatible:
> +    const: nxp,pnx-i2c
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +

> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0

These 2 are defined in i2c-controller.yaml, so drop.

> +
> +  clock-frequency:
> +    default: 100000
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c1: i2c@400a0000 {

Drop unused labels.

> +        compatible = "nxp,pnx-i2c";
> +        reg = <0x400a0000 0x100>;
> +        interrupt-parent = <&mic>;
> +        interrupts = <51 0>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +    };
> -- 
> 2.44.0
>
Animesh Agarwal March 18, 2024, 3:09 p.m. UTC | #2
On Mon, Mar 18, 2024 at 7:53 PM Rob Herring <robh@kernel.org> wrote:
> Doesn't quite match the compatible string.
Will change the file name to nxp,pnx-i2c.yaml
> These 2 are defined in i2c-controller.yaml, so drop.
> Drop unused labels.

Making these fixes in v2.

Thanks,
Animesh
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pnx.txt b/Documentation/devicetree/bindings/i2c/i2c-pnx.txt
deleted file mode 100644
index 2a59006cf79e..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-pnx.txt
+++ /dev/null
@@ -1,34 +0,0 @@ 
-* NXP PNX I2C Controller
-
-Required properties:
-
- - reg: Offset and length of the register set for the device
- - compatible: should be "nxp,pnx-i2c"
- - interrupts: configure one interrupt line
- - #address-cells: always 1 (for i2c addresses)
- - #size-cells: always 0
-
-Optional properties:
-
- - clock-frequency: desired I2C bus clock frequency in Hz, Default: 100000 Hz
-
-Examples:
-
-	i2c1: i2c@400a0000 {
-		compatible = "nxp,pnx-i2c";
-		reg = <0x400a0000 0x100>;
-		interrupt-parent = <&mic>;
-		interrupts = <51 0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
-
-	i2c2: i2c@400a8000 {
-		compatible = "nxp,pnx-i2c";
-		reg = <0x400a8000 0x100>;
-		interrupt-parent = <&mic>;
-		interrupts = <50 0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clock-frequency = <100000>;
-	};
diff --git a/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml b/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml
new file mode 100644
index 000000000000..b44e4f995b73
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/nxp,i2c-pnx.yaml
@@ -0,0 +1,52 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/nxp,i2c-pnx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PNX I2C Controller
+
+maintainers:
+  - Animesh Agarwal<animeshagarwal28@gmail.com>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    const: nxp,pnx-i2c
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  clock-frequency:
+    default: 100000
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#address-cells"
+  - "#size-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c1: i2c@400a0000 {
+        compatible = "nxp,pnx-i2c";
+        reg = <0x400a0000 0x100>;
+        interrupt-parent = <&mic>;
+        interrupts = <51 0>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };