devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Marc Dietrich <marvin24@gmx.de>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	devicetree@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [PATCH 3/5] dt-bindings: arm: tegra: nvec: Convert to json-schema
Date: Mon, 11 Jul 2022 17:20:18 +0200	[thread overview]
Message-ID: <20220711152020.688461-3-thierry.reding@gmail.com> (raw)
In-Reply-To: <20220711152020.688461-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

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

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Marc,

you authored this binding a long time ago, which makes the default
license for this GPL-2.0. However, the preference is for DT bindings to
be dual-licensed under the more permissive GPL-2.0-only OR BSD-2-Clause
as done in this patch. Do you have any objections to relicensing?

Thierry

 .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
 .../bindings/arm/tegra/nvidia,nvec.yaml       | 94 +++++++++++++++++++
 2 files changed, 94 insertions(+), 21 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
 create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.yaml

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/arm/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.yaml
new file mode 100644
index 000000000000..c997faa42c31
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/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:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: frequency of the I2C bus
+
+  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
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+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>
+
+    nvec@7000c500 {
+      compatible = "nvidia,nvec";
+      reg = <0x7000c500 0x100>;
+      interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+      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";
+    };
-- 
2.36.1


  parent reply	other threads:[~2022-07-11 15:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 15:20 [PATCH 1/5] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
2022-07-11 15:20 ` [PATCH 2/5] dt-bindings: arm: tegra: ahb: " Thierry Reding
2022-07-12  8:20   ` Krzysztof Kozlowski
2022-07-11 15:20 ` Thierry Reding [this message]
2022-07-12  8:24   ` [PATCH 3/5] dt-bindings: arm: tegra: nvec: " Krzysztof Kozlowski
2022-07-17 21:31   ` Marc Dietrich
2022-07-11 15:20 ` [PATCH 4/5] dt-bindings: arm: tegra: Revise Tegra20 PMC bindings Thierry Reding
2022-07-12  8:28   ` Krzysztof Kozlowski
2022-07-11 15:20 ` [PATCH 5/5] dt-bindings: arm: tegra: Add missing compatible strings Thierry Reding
2022-07-11 15:36   ` Francesco Dolcini
2022-07-11 16:41     ` Thierry Reding
2022-07-12  8:30   ` Krzysztof Kozlowski
2022-07-12  8:19 ` [PATCH 1/5] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220711152020.688461-3-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marvin24@gmx.de \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).