Re: [PATCH v1 17/43] dt-bindings: spi: Add Cirrus EP93xx

From: Krzysztof Kozlowski
Date: Thu Jun 01 2023 - 04:16:35 EST


On 01/06/2023 07:34, Nikita Shubin wrote:
> Add YAML bindings for ep93xx SoC SPI.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
> ---
>
> Notes:
> v0 -> v1:
> Krzysztof Kozlowski:
> - replaced maintainers
> - removed wildcards
> - use fallback compatible and list all possible compatibles
> - drop quotes in ref
> - dropped "clock-names"
> - dropped label
> - fix ident
>
> .../devicetree/bindings/spi/spi-ep9301.yaml | 69 +++++++++++++++++++
> 1 file changed, 69 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/spi/spi-ep9301.yaml
>
> diff --git a/Documentation/devicetree/bindings/spi/spi-ep9301.yaml b/Documentation/devicetree/bindings/spi/spi-ep9301.yaml
> new file mode 100644
> index 000000000000..c363b25a3074
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-ep9301.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/spi-ep9301.yaml#

Filename based on compatible, so missing prefix, wrong order of name
components.

This applies everywhere, not to some files only. Applied to all your
bindings.

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: EP93xx SoC SPI controller
> +
> +maintainers:
> + - Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
> + - Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
> +
> +allOf:
> + - $ref: spi-controller.yaml#
> +
> +properties:
> + "#address-cells": true
> + "#size-cells": true

Drop these two.

> +
> + compatible:

Anyway, compatible is always first.

> + oneOf:
> + - const: cirrus,ep9301-spi
> + - items:
> + - enum:
> + - cirrus,ep9302-spi
> + - cirrus,ep9307-spi
> + - cirrus,ep9312-spi
> + - cirrus,ep9315-spi
> + - const: cirrus,ep9301-spi
> +
> + reg:
> + items:
> + - description: SPI registers region
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: SPI Controller reference clock source
> +
> + cs-gpios: true

Drop, not needed.

> +
> + cirrus,ep9301-use-dma:
> + description: Flag indicating that the SPI should use dma
> + type: boolean

In such case where are dmas? Unless you meant some internal dma
controller? In such case extend the description because now it just
duplicates property name.


> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/cirrus,ep93xx-clock.h>
> + spi@808a0000 {
> + compatible = "cirrus,ep9301-spi";
> + reg = <0x808a0000 0x18>;
> + interrupt-parent = <&vic1>;
> + interrupts = <21>;
> + clocks = <&syscon EP93XX_CLK_SPI>;
> + cs-gpios = <&gpio5 2 0>;

Use proper gpio defines for flags.

> + cirrus,ep9301-use-dma;
> + };
> +
> +...

Best regards,
Krzysztof