diff mbox series

[v3] dt-bindings: arm: tegra: nvec: Convert to json-schema

Message ID 20230721124623.2988445-1-thierry.reding@gmail.com
State Accepted
Headers show
Series [v3] dt-bindings: arm: tegra: nvec: Convert to json-schema | expand

Commit Message

Thierry Reding July 21, 2023, 12:46 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Convert the NVIDIA embedded controller bindings from the free-form text
format to json-schema.

Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v3:
- rename node to i2c to clarify that it's a repurposed I2C controller
- drop unused #address-cells and #size-cells

Changes in v2:
- drop $ref for standard clock-frequency property
- use 4 spaces for indentation in example
- move to soc/tegra directory
---
 .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
 .../bindings/soc/tegra/nvidia,nvec.yaml       | 84 +++++++++++++++++++
 2 files changed, 84 insertions(+), 21 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml

Comments

Rob Herring (Arm) July 24, 2023, 4:04 p.m. UTC | #1
On Fri, 21 Jul 2023 14:46:23 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Convert the NVIDIA embedded controller bindings from the free-form text
> format to json-schema.
> 
> Acked-by: Marc Dietrich <marvin24@gmx.de>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> Changes in v3:
> - rename node to i2c to clarify that it's a repurposed I2C controller
> - drop unused #address-cells and #size-cells
> 
> Changes in v2:
> - drop $ref for standard clock-frequency property
> - use 4 spaces for indentation in example
> - move to soc/tegra directory
> ---
>  .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
>  .../bindings/soc/tegra/nvidia,nvec.yaml       | 84 +++++++++++++++++++
>  2 files changed, 84 insertions(+), 21 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
>  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Thierry Reding July 25, 2023, 4:32 p.m. UTC | #2
From: Thierry Reding <treding@nvidia.com>


On Fri, 21 Jul 2023 14:46:23 +0200, Thierry Reding wrote:
> Convert the NVIDIA embedded controller bindings from the free-form text
> format to json-schema.
> 
> 

Applied, thanks!

[1/1] dt-bindings: arm: tegra: nvec: Convert to json-schema
      commit: 436ebd32b02568378eb694f97f5c1c2fa8c984c8

Best regards,
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
deleted file mode 100644
index 5ae601e7f51f..000000000000
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
+++ /dev/null
@@ -1,21 +0,0 @@ 
-NVIDIA compliant embedded controller
-
-Required properties:
-- compatible : should be "nvidia,nvec".
-- reg : the iomem of the i2c slave controller
-- interrupts : the interrupt line of the i2c slave controller
-- clock-frequency : the frequency of the i2c bus
-- gpios : the gpio used for ec request
-- slave-addr: the i2c address of the slave controller
-- 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
-- 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
diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
new file mode 100644
index 000000000000..d5261ce3a619
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
@@ -0,0 +1,84 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,nvec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA compliant embedded controller
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jon Hunter <jonathanh@nvidia.com>
+
+properties:
+  compatible:
+    const: nvidia,nvec
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: divider clock
+      - description: fast clock
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: div-clk
+      - const: fast-clk
+
+  resets:
+    items:
+      - description: module reset
+
+  reset-names:
+    items:
+      - const: i2c
+
+  clock-frequency: true
+
+  request-gpios:
+    description: phandle to the GPIO used for EC request
+
+  slave-addr:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: I2C address of the slave controller
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+  - clock-frequency
+  - request-gpios
+  - slave-addr
+
+examples:
+  - |
+    #include <dt-bindings/clock/tegra20-car.h>
+    #include <dt-bindings/gpio/tegra-gpio.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    i2c@7000c500 {
+        compatible = "nvidia,nvec";
+        reg = <0x7000c500 0x100>;
+        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+        clock-frequency = <80000>;
+        request-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
+        slave-addr = <138>;
+        clocks = <&tegra_car TEGRA20_CLK_I2C3>,
+                 <&tegra_car TEGRA20_CLK_PLL_P_OUT3>;
+        clock-names = "div-clk", "fast-clk";
+        resets = <&tegra_car 67>;
+        reset-names = "i2c";
+    };