Re: [PATCH 11/13] dt-bindings: iio: offload: add binding for PWM/DMA triggered buffer

From: Rob Herring
Date: Wed Jan 10 2024 - 17:56:32 EST


On Wed, Jan 10, 2024 at 01:49:52PM -0600, David Lechner wrote:
> This adds a new binding for a PWM trigger and DMA data output connected
> to an SPI controller offload instance.
>
> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
> ---
> .../adi,spi-offload-pwm-trigger-dma-buffer.yaml | 59 ++++++++++++++++++++++
> 1 file changed, 59 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/offload/adi,spi-offload-pwm-trigger-dma-buffer.yaml b/Documentation/devicetree/bindings/iio/offload/adi,spi-offload-pwm-trigger-dma-buffer.yaml
> new file mode 100644
> index 000000000000..748cfab19eff
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/offload/adi,spi-offload-pwm-trigger-dma-buffer.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/offload/adi,spi-offload-pwm-trigger-dma-buffer.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: SPI Offload with PWM Trigger and DMA Buffer Data Output
> +
> +maintainers:
> + - Michael Hennerich <Michael.Hennerich@xxxxxxxxxx>
> + - Nuno Sá <nuno.sa@xxxxxxxxxx>
> +
> +description: |
> + This binding describes the connection of a PWM device to the trigger input
> + and a DMA channel to the output data stream of a SPI Offload instance.
> +
> + https://wiki.analog.com/resources/fpga/peripherals/spi_engine/offload
> + https://wiki.analog.com/resources/fpga/peripherals/spi_engine/tutorial
> +
> +$ref: /schemas/spi/adi,axi-spi-engine.yaml#/$defs/offload

Not really worth the complexity just for 'reg'. Generally, the bus
schema would define general constraints on reg like range of address
values and the device schema (this one) is just how many entries.

> +
> +properties:
> + compatible:
> + const: adi,spi-offload-pwm-trigger-dma-buffer
> +
> + reg:
> + maxItems: 1
> +
> + pwms:
> + maxItems: 1
> +
> + dmas:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - pwms
> + - dmas
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + offloads {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + offload@0 {
> + compatible = "adi,spi-offload-pwm-trigger-dma-buffer";
> + reg = <0>;
> + pwms = <&pwm 0>;
> + dmas = <&dma 0>;
> + };
> + };

Just make one complete example for the device.

> + };
>
> --
> 2.43.0
>