Re: [PATCH V2 1/3] dt-bindings: spi: Convert mxs spi to json-schema

2020-06-15 Thread Rob Herring
On Thu, Jun 04, 2020 at 09:55:29AM +0800, Anson Huang wrote:
> Convert the MXS SPI binding to DT schema format using json-schema
> 
> Signed-off-by: Anson Huang 
> ---
> Changes since V1:
>   - add "unevaluatedProperties: false".
> ---
>  Documentation/devicetree/bindings/spi/mxs-spi.txt  | 26 --
>  Documentation/devicetree/bindings/spi/mxs-spi.yaml | 57 
> ++
>  2 files changed, 57 insertions(+), 26 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/spi/mxs-spi.txt
>  create mode 100644 Documentation/devicetree/bindings/spi/mxs-spi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.txt 
> b/Documentation/devicetree/bindings/spi/mxs-spi.txt
> deleted file mode 100644
> index 3499b73..000
> --- a/Documentation/devicetree/bindings/spi/mxs-spi.txt
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -* Freescale MX233/MX28 SSP/SPI
> -
> -Required properties:
> -- compatible: Should be "fsl,-spi", where soc is "imx23" or "imx28"
> -- reg: Offset and length of the register set for the device
> -- interrupts: Should contain SSP ERROR interrupt
> -- dmas: DMA specifier, consisting of a phandle to DMA controller node
> -  and SSP DMA channel ID.
> -  Refer to dma.txt and fsl-mxs-dma.txt for details.
> -- dma-names: Must be "rx-tx".
> -
> -Optional properties:
> -- clock-frequency : Input clock frequency to the SPI block in Hz.
> - Default is 16000 Hz.
> -
> -Example:
> -
> -ssp0: ssp@8001 {
> - #address-cells = <1>;
> - #size-cells = <0>;
> - compatible = "fsl,imx28-spi";
> - reg = <0x8001 0x2000>;
> - interrupts = <96>;
> - dmas = <_apbh 0>;
> - dma-names = "rx-tx";
> -};
> diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.yaml 
> b/Documentation/devicetree/bindings/spi/mxs-spi.yaml
> new file mode 100644
> index 000..68c5d6d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/mxs-spi.yaml
> @@ -0,0 +1,57 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/mxs-spi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale MX233/MX28 SSP/SPI
> +
> +maintainers:
> +  - Marek Vasut 
> +
> +allOf:
> +  - $ref: "/schemas/spi/spi-controller.yaml#"
> +
> +properties:
> +  compatible:
> +enum:
> +  - fsl,imx23-spi
> +  - fsl,imx28-spi
> +
> +  reg:
> +maxItems: 1
> +
> +  interrupts:
> +maxItems: 1
> +
> +  dmas:
> +maxItems: 1
> +
> +  dma-names:
> +const: rx-tx
> +
> +  clock-frequency:
> +$ref: /schemas/types.yaml#/definitions/uint32

Already has a type, drop.

With that,

Reviewed-by: Rob Herring 

> +description: input clock frequency to the SPI block in Hz.
> +default: 16000
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - dmas
> +  - dma-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +spi@8001 {
> +#address-cells = <1>;
> +#size-cells = <0>;
> +compatible = "fsl,imx28-spi";
> +reg = <0x8001 0x2000>;
> +interrupts = <96>;
> +dmas = <_apbh 0>;
> +dma-names = "rx-tx";
> +};
> -- 
> 2.7.4
> 


[PATCH V2 1/3] dt-bindings: spi: Convert mxs spi to json-schema

2020-06-03 Thread Anson Huang
Convert the MXS SPI binding to DT schema format using json-schema

Signed-off-by: Anson Huang 
---
Changes since V1:
- add "unevaluatedProperties: false".
---
 Documentation/devicetree/bindings/spi/mxs-spi.txt  | 26 --
 Documentation/devicetree/bindings/spi/mxs-spi.yaml | 57 ++
 2 files changed, 57 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/spi/mxs-spi.txt
 create mode 100644 Documentation/devicetree/bindings/spi/mxs-spi.yaml

diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.txt 
b/Documentation/devicetree/bindings/spi/mxs-spi.txt
deleted file mode 100644
index 3499b73..000
--- a/Documentation/devicetree/bindings/spi/mxs-spi.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-* Freescale MX233/MX28 SSP/SPI
-
-Required properties:
-- compatible: Should be "fsl,-spi", where soc is "imx23" or "imx28"
-- reg: Offset and length of the register set for the device
-- interrupts: Should contain SSP ERROR interrupt
-- dmas: DMA specifier, consisting of a phandle to DMA controller node
-  and SSP DMA channel ID.
-  Refer to dma.txt and fsl-mxs-dma.txt for details.
-- dma-names: Must be "rx-tx".
-
-Optional properties:
-- clock-frequency : Input clock frequency to the SPI block in Hz.
-   Default is 16000 Hz.
-
-Example:
-
-ssp0: ssp@8001 {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   compatible = "fsl,imx28-spi";
-   reg = <0x8001 0x2000>;
-   interrupts = <96>;
-   dmas = <_apbh 0>;
-   dma-names = "rx-tx";
-};
diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.yaml 
b/Documentation/devicetree/bindings/spi/mxs-spi.yaml
new file mode 100644
index 000..68c5d6d
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/mxs-spi.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/mxs-spi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MX233/MX28 SSP/SPI
+
+maintainers:
+  - Marek Vasut 
+
+allOf:
+  - $ref: "/schemas/spi/spi-controller.yaml#"
+
+properties:
+  compatible:
+enum:
+  - fsl,imx23-spi
+  - fsl,imx28-spi
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  dmas:
+maxItems: 1
+
+  dma-names:
+const: rx-tx
+
+  clock-frequency:
+$ref: /schemas/types.yaml#/definitions/uint32
+description: input clock frequency to the SPI block in Hz.
+default: 16000
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - dmas
+  - dma-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+spi@8001 {
+#address-cells = <1>;
+#size-cells = <0>;
+compatible = "fsl,imx28-spi";
+reg = <0x8001 0x2000>;
+interrupts = <96>;
+dmas = <_apbh 0>;
+dma-names = "rx-tx";
+};
-- 
2.7.4