diff mbox series

[v6,2/2] dt-bindings:spi: Add Sunplus SP7021 schema

Message ID ef6d893b10afb7f76a910da031a0040c4596cd76.1642494310.git.lhjeff911@gmail.com
State Not Applicable, archived
Headers show
Series Add spi control driver for Sunplus SP7021 SoC | expand

Checks

Context Check Description
robh/checkpatch success
robh/dtbs-check success
robh/dt-meta-schema success
robh/checkpatch success
robh/dtbs-check success
robh/dt-meta-schema fail build log

Commit Message

Li-hao Kuo Jan. 18, 2022, 8:42 a.m. UTC
Add bindings for Sunplus SP7021 spi driver

Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
---
Changes in v6:
 - Change the interrupt-names 
   mas_risc to master_risc
 - Addressed comments from Mr. Andy Shevchenko
   Change the function name: mas is master and sla is slave.
   Add temporary varilable (as suggested by Mr. Andy Shevchenko)
   Modify clk setting
   Modify the master-slave detection of the probe function.(as suggested by Mr. Andy Shevchenko)
   Modify the return value of the probe function.(as suggested by Mr. Andy Shevchenko)
   Change GPL version(as suggested by Mr. Andy Shevchenko)

 .../bindings/spi/spi-sunplus-sp7021.yaml           | 81 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 82 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml

Comments

Rob Herring Jan. 27, 2022, 3:16 p.m. UTC | #1
On Tue, Jan 18, 2022 at 2:42 AM Li-hao Kuo <lhjeff911@gmail.com> wrote:
>
> Add bindings for Sunplus SP7021 spi driver
>
> Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
> ---
> Changes in v6:
>  - Change the interrupt-names
>    mas_risc to master_risc
>  - Addressed comments from Mr. Andy Shevchenko
>    Change the function name: mas is master and sla is slave.
>    Add temporary varilable (as suggested by Mr. Andy Shevchenko)
>    Modify clk setting
>    Modify the master-slave detection of the probe function.(as suggested by Mr. Andy Shevchenko)
>    Modify the return value of the probe function.(as suggested by Mr. Andy Shevchenko)
>    Change GPL version(as suggested by Mr. Andy Shevchenko)
>
>  .../bindings/spi/spi-sunplus-sp7021.yaml           | 81 ++++++++++++++++++++++
>  MAINTAINERS                                        |  1 +
>  2 files changed, 82 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml

This is now failing in linux-next, please fix:

/builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml:
properties:reg:items: 'anyOf' conditional failed, one must be fixed:
 ['the SPI master registers', 'the SPI slave registers'] is not of
type 'object', 'boolean'
 'the SPI master registers' is not of type 'object', 'boolean'
 'the SPI slave registers' is not of type 'object', 'boolean'
 from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml:
ignoring, error in schema: properties: reg: items
Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.example.dts:19:18:
fatal error: dt-bindings/clock/sp-sp7021.h: No such file or directory
 19 | #include <dt-bindings/clock/sp-sp7021.h>
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:390:
Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.example.dt.yaml]
Error 1
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml b/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml
new file mode 100644
index 0000000..24382cd
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml
@@ -0,0 +1,81 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/spi-sunplus-sp7021.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus sp7021 SPI controller
+
+allOf:
+  - $ref: "spi-controller.yaml"
+
+maintainers:
+  - Li-hao Kuo <lhjeff911@gmail.com>
+
+properties:
+  compatible:
+    enum:
+      - sunplus,sp7021-spi
+
+  reg:
+    items:
+      - the SPI master registers
+      - the SPI slave registers
+
+  reg-names:
+    items:
+      - const: master
+      - const: slave
+
+  interrupt-names:
+    items:
+      - const: dma_w
+      - const: master_risc
+      - const: slave_risc
+
+  interrupts:
+    minItems: 3
+
+  clocks:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clocks-names
+  - resets
+  - pinctrl-names
+  - pinctrl-0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/sp-sp7021.h>
+    #include <dt-bindings/reset/sp-sp7021.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi@9C002D80 {
+        compatible = "sunplus,sp7021-spi";
+        reg = <0x9C002D80 0x80>, <0x9C002E00 0x80>;
+        reg-names = "master", "slave";
+        interrupt-parent = <&intc>;
+        interrupt-names = "dma_w",
+                          "master_risc",
+                          "slave_risc";
+        interrupts = <144 IRQ_TYPE_LEVEL_HIGH>,
+                     <146 IRQ_TYPE_LEVEL_HIGH>,
+                     <145 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clkc SPI_COMBO_0>;
+        resets = <&rstc RST_SPI_COMBO_0>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&pins_spi0>;
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index a07da20..2e14650 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -18497,6 +18497,7 @@  SUNPLUS SPI CONTROLLER INTERFACE DRIVER
 M:	Li-hao Kuo <lhjeff911@gmail.com>
 L:	linux-spi@vger.kernel.org
 S:	Maintained
+F:	Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml
 F:	drivers/spi/spi-sunplus-sp7021.c
 
 SUPERH