[16/43] dt-bindings: spi: Add DT bindings ep93xx spi

Message ID 20230424123522.18302-17-nikita.shubin@maquefel.me
State New
Headers
Series ep93xx device tree conversion |

Commit Message

Nikita Shubin April 24, 2023, 12:34 p.m. UTC
  Add YAML bindings for ep93xx SoC.

Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 .../devicetree/bindings/spi/spi-ep93xx.yaml   | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
  

Comments

Mark Brown April 24, 2023, 3:54 p.m. UTC | #1
On Mon, Apr 24, 2023 at 03:34:32PM +0300, Nikita Shubin wrote:

> +maintainers:
> +  - Mark Brown <broonie@kernel.org>

This needs to be someone who actually knows about and works on the
device.

> +  use_dma:
> +    type: boolean
> +    items:
> +      - description: Flag indicating that the SPI should use dma

There don't seem to be any DMA properties here, and why would this not
just be done by making them optional rather than having a separate
specific property?
  
Rob Herring April 24, 2023, 4:08 p.m. UTC | #2
On Mon, Apr 24, 2023 at 03:34:32PM +0300, Nikita Shubin wrote:
> Add YAML bindings for ep93xx SoC.
> 
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
>  .../devicetree/bindings/spi/spi-ep93xx.yaml   | 68 +++++++++++++++++++
>  1 file changed, 68 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml b/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
> new file mode 100644
> index 000000000000..e09ab50629fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
> @@ -0,0 +1,68 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/spi-ep93xx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: EP93xx SoC SPI controller
> +
> +maintainers:
> +  - Mark Brown <broonie@kernel.org>
> +
> +allOf:
> +  - $ref: "spi-controller.yaml#"

Drop quotes.

> +
> +properties:
> +  "#address-cells": true
> +  "#size-cells": true
> +
> +  compatible:
> +    items:
> +      - const: cirrus,ep9301-spi
> +
> +  reg:
> +    items:
> +      - description: SPI registers region
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: SPI Controller reference clock source
> +
> +  clock-names:
> +    items:
> +      - const: ep93xx-spi.0

Does not sound like a clock name... Just drop unless you expect to add 
more clocks.

> +
> +  cs-gpios: true
> +
> +  use_dma:

Don't use '_' in property names. Custom properties need a vendor prefix.

However, this looks like a driver setting rather than h/w config. Why 
not always use DMA or transfers above X size. IOW, let the driver figure 
it out.

> +    type: boolean
> +    items:

'items' is for an array, but this is a boolean.

> +      - description: Flag indicating that the SPI should use dma
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/cirrus,ep93xx-clock.h>
> +    spi0: spi@808a0000 {
> +        compatible = "cirrus,ep9301-spi";
> +        reg = <0x808a0000 0x18>;
> +        interrupt-parent = <&vic1>;
> +        interrupts = <21>;
> +        clocks = <&syscon EP93XX_CLK_SPI>;
> +        clock-names = "ep93xx-spi.0";
> +        cs-gpios = <&gpio5 2 0>;
> +        use_dma;
> +    };
> +
> +...
> -- 
> 2.39.2
>
  

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml b/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
new file mode 100644
index 000000000000..e09ab50629fb
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-ep93xx.yaml
@@ -0,0 +1,68 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/spi-ep93xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: EP93xx SoC SPI controller
+
+maintainers:
+  - Mark Brown <broonie@kernel.org>
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+properties:
+  "#address-cells": true
+  "#size-cells": true
+
+  compatible:
+    items:
+      - const: cirrus,ep9301-spi
+
+  reg:
+    items:
+      - description: SPI registers region
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: SPI Controller reference clock source
+
+  clock-names:
+    items:
+      - const: ep93xx-spi.0
+
+  cs-gpios: true
+
+  use_dma:
+    type: boolean
+    items:
+      - description: Flag indicating that the SPI should use dma
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/cirrus,ep93xx-clock.h>
+    spi0: spi@808a0000 {
+        compatible = "cirrus,ep9301-spi";
+        reg = <0x808a0000 0x18>;
+        interrupt-parent = <&vic1>;
+        interrupts = <21>;
+        clocks = <&syscon EP93XX_CLK_SPI>;
+        clock-names = "ep93xx-spi.0";
+        cs-gpios = <&gpio5 2 0>;
+        use_dma;
+    };
+
+...