linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wan.ahmad.zainie.wan.mohamad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: [PATCH 3/7] dt-bindings: spi: dw-apb-ssi: Convert bindings to json-schema
Date: Thu, 12 Mar 2020 19:31:25 +0800	[thread overview]
Message-ID: <20200312113129.8198-4-wan.ahmad.zainie.wan.mohamad@intel.com> (raw)
In-Reply-To: <20200312113129.8198-1-wan.ahmad.zainie.wan.mohamad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Convert the Synopsis DesignWare dw-apb-ssi binding to DT schema format
using json-schema.

Suggested-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 .../bindings/spi/snps,dw-apb-ssi.txt          |  41 -------
 .../bindings/spi/snps,dw-apb-ssi.yaml         | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 41 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt
 create mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

diff --git a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt b/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt
deleted file mode 100644
index 3ed08ee9feba..000000000000
--- a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Synopsys DesignWare AMBA 2.0 Synchronous Serial Interface.
-
-Required properties:
-- compatible : "snps,dw-apb-ssi" or "mscc,<soc>-spi", where soc is "ocelot" or
-  "jaguar2", or "amazon,alpine-dw-apb-ssi"
-- reg : The register base for the controller. For "mscc,<soc>-spi", a second
-  register set is required (named ICPU_CFG:SPI_MST)
-- interrupts : One interrupt, used by the controller.
-- #address-cells : <1>, as required by generic SPI binding.
-- #size-cells : <0>, also as required by generic SPI binding.
-- clocks : phandles for the clocks, see the description of clock-names below.
-   The phandle for the "ssi_clk" is required. The phandle for the "pclk" clock
-   is optional. If a single clock is specified but no clock-name, it is the
-   "ssi_clk" clock. If both clocks are listed, the "ssi_clk" must be first.
-
-Optional properties:
-- clock-names : Contains the names of the clocks:
-    "ssi_clk", for the core clock used to generate the external SPI clock.
-    "pclk", the interface clock, required for register access. If a clock domain
-     used to enable this clock then it should be named "pclk_clkdomain".
-- cs-gpios : Specifies the gpio pins to be used for chipselects.
-- num-cs : The number of chipselects. If omitted, this will default to 4.
-- reg-io-width : The I/O register width (in bytes) implemented by this
-  device.  Supported values are 2 or 4 (the default).
-
-Child nodes as per the generic SPI binding.
-
-Example:
-
-	spi@fff00000 {
-		compatible = "snps,dw-apb-ssi";
-		reg = <0xfff00000 0x1000>;
-		interrupts = <0 154 4>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&spi_m_clk>;
-		num-cs = <2>;
-		cs-gpios = <&gpio0 13 0>,
-			   <&gpio0 14 0>;
-	};
-
diff --git a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml b/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
new file mode 100644
index 000000000000..57a789f5d9f3
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Synopsys DesignWare AMBA 2.0 Synchronous Serial Interface
+
+maintainers:
+  - Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - mscc,ocelot-spi
+              - mscc,jaguar2-spi
+      - items:
+          - const: amazon,alpine-dw-apb-ssi
+      - items:
+          - const: snps,dw-apb-ssi
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    oneOf:
+      - items:
+          - description: The register base for the controller.
+      - items:
+          - description: The register base for the controller.
+          - description: For "mscc,<soc>-spi", a second register set is
+                         required (named ICPU_CFG:SPI_MST)
+
+  interrupts:
+    maxItems: 1
+    description: One interrupt, used by the controller.
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+    description: |
+      phandles for the clocks, see the description of clock-names below.
+      The phandle for the "ssi_clk" is required. The phandle for the "pclk"
+      clock is optional. If a single clock is specified but no clock-name,
+      it is the "ssi_clk" clock. If both clocks are listed, the "ssi_clk"
+      must be first.
+
+  clock-names:
+    items:
+      - const: ssi_clk
+      - const: pclk
+    description: |
+      Contains the names of the clocks.
+      "ssi_clk", for the core clock used to generate the external SPI clock.
+      "pclk", the interface clock, required for register access.
+      If a clock domain used to enable this clock then it should be
+      named "pclk_clkdomain".
+
+  cs-gpios:
+    description: Specifies the gpio pins to be used for chipselects.
+
+  num-cs:
+    default: 4
+    description: The number of chipselects. If omitted, this will default to 4.
+
+  reg-io-width:
+    default: 4
+    description: |
+      The I/O register width (in bytes) implemented by this device.
+      Supported values are 2 or 4 (the default).
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - '#address-cells'
+  - '#size-cells'
+  - clocks
+
+examples:
+  - |
+    spi@fff00000 {
+          compatible = "snps,dw-apb-ssi";
+          reg = <0xfff00000 0x1000>;
+          interrupts = <0 154 4>;
+          #address-cells = <1>;
+          #size-cells = <0>;
+          clocks = <&spi_m_clk>;
+          num-cs = <2>;
+          cs-gpios = <&gpio0 13 0>,
+                     <&gpio0 14 0>;
+    };
-- 
2.17.1

  parent reply	other threads:[~2020-03-12 11:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 11:31 [PATCH 0/7] spi:dw: Add support for Intel Keem Bay SPI Wan Ahmad Zainie
     [not found] ` <20200312113129.8198-1-wan.ahmad.zainie.wan.mohamad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2020-03-12 11:31   ` [PATCH 1/7] spi: dw: Fix typo in few registers name Wan Ahmad Zainie
2020-03-12 11:31   ` [PATCH 2/7] spi: dw: Add update_cr0() callback to update CTRLR0 Wan Ahmad Zainie
2020-03-12 11:31   ` Wan Ahmad Zainie [this message]
2020-03-30 16:54     ` [PATCH 3/7] dt-bindings: spi: dw-apb-ssi: Convert bindings to json-schema Rob Herring
2020-04-02  6:21       ` Wan Mohamad, Wan Ahmad Zainie
2020-03-12 11:31   ` [PATCH 4/7] dt-bindings: spi: dw-apb-ssi: Add compatible string for DesignWare DWC_ssi Wan Ahmad Zainie
2020-03-12 11:31   ` [PATCH 5/7] spi: dw: Add support " Wan Ahmad Zainie
2020-03-12 11:31   ` [PATCH 6/7] dt-bindings: spi: dw-apb-ssi: Add Intel Keem Bay support Wan Ahmad Zainie
2020-03-12 11:31   ` [PATCH 7/7] spi: dw: Add support for Intel Keem Bay SPI Wan Ahmad Zainie

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=20200312113129.8198-4-wan.ahmad.zainie.wan.mohamad@intel.com \
    --to=wan.ahmad.zainie.wan.mohamad-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).