Re: [PATCH] dt-bindings: spi: Add YAML DT binding document for trivial devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 7, 2022 at 2:49 PM Marek Vasut <marex@xxxxxxx> wrote:
>

'dt-bindings' pretty much implies or says 'YAML DT binding document'
already. Given limited subject line, don't repeat yourself.

> Document trivial SPI devices in single YAML DT binding document.
> Currently this overlaps Linux kernel spidev.
>
> Signed-off-by: Marek Vasut <marex@xxxxxxx>
> Cc: Mark Brown <broonie@xxxxxxxxxx>
> Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> Cc: devicetree@xxxxxxxxxxxxxxx
> To: linux-spi@xxxxxxxxxxxxxxx
> ---
>  .../devicetree/bindings/spi/trivial.yaml      | 51 +++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/trivial.yaml
>
> diff --git a/Documentation/devicetree/bindings/spi/trivial.yaml b/Documentation/devicetree/bindings/spi/trivial.yaml
> new file mode 100644
> index 0000000000000..6d6e682948dfc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/trivial.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/trivial.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Trivial SPI device DT bindings
> +

Add 'description' and describe what devices do and don't qualify as
trivial. (And you can't say 'spidev' :)).

> +maintainers:
> +  - Marek Vasut <marex@xxxxxxx>
> +  - Mark Brown <broonie@xxxxxxxxxx>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - cisco,spi-petra
> +      - dh,dhcom-board
> +      - lineartechnology,ltc2488
> +      - lwn,bk4

This one is a *board*!. Wait, and a device... I suppose that's
possible if the board can be a device in another system. Except both
are used in the same dts file. That should create some nice warnings,
but I'm not sure anyone is paying attention to fsl.yaml warnings.

In any case, we're left with
Documentation/devicetree/bindings/misc/lwn-bk4.txt. That and any other
cases need to be deleted.

> +      - menlo,m53cpld
> +      - micron,spi-authenta
> +      - rohm,dh2228fv

This is a DAC. We have lots of DACs in trivial-devices.yaml already.
How does one decide where to document?

> +      - semtech,sx1301
> +
> +  reg:
> +    description: Chip select
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +  spi-cs-high: true

Reference spi-peripheral-props.yaml and drop these. Will also need to
use unevaluatedProperties.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    spi {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      spidev@0 {

dac@0

> +        compatible = "rohm,dh2228fv";
> +        reg = <0>;
> +        spi-max-frequency = <1000000>;
> +      };
> +    };
> --
> 2.35.1
>



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux