[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230428215641.GA332435-robh@kernel.org>
Date: Fri, 28 Apr 2023 16:56:41 -0500
From: Rob Herring <robh@...nel.org>
To: Valentin Caron <valentin.caron@...s.st.com>
Cc: Mark Brown <broonie@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Alain Volmat <alain.volmat@...s.st.com>,
linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/7] dt-bindings: spi: stm32: add stm32h7
st,spi-slave-underrun property
On Fri, Apr 28, 2023 at 02:15:23PM +0200, Valentin Caron wrote:
> This property is used to enable and configure stm32h7 SPI controller to
> handle underrun that could appear in slave mode.
>
> Signed-off-by: Valentin Caron <valentin.caron@...s.st.com>
> ---
> .../devicetree/bindings/spi/st,stm32-spi.yaml | 8 ++++++++
> MAINTAINERS | 1 +
> include/dt-bindings/spi/spi-stm32.h | 15 +++++++++++++++
> 3 files changed, 24 insertions(+)
> create mode 100644 include/dt-bindings/spi/spi-stm32.h
>
> diff --git a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> index 1d26fa2658c5..e946ea71a247 100644
> --- a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> +++ b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> @@ -28,6 +28,7 @@ allOf:
> properties:
> st,spi-midi-ns: false
> spi-slave: false
> + st,spi-slave-underrun: false
>
> properties:
> "#address-cells": true
> @@ -70,6 +71,13 @@ properties:
> In case of spi-slave defined, if <0>, indicate that SS should be
> detected via the dedicated HW pin
>
> + st,spi-slave-underrun:
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + description:
> + First parameter enables and selects slave underrun reaction.
> + Refer to "dt-bindings/spi/spi-stm32.h" for the supported values.
> + Second parameter is the pattern in case of SPI_SEND_PATTERN mode.
So, max 2 cells? Then:
minItems: 1
maxItems: 2
Though I don't really think this belongs in DT. The driver implementing
the SPI slave function defines all the rest of the protocol the slave
implements. Why not this little bit? Perhaps there is no way for a SPI
slave driver to tell the SPI controller which controller specific mode
to use, so you abuse DT to configure the SPI controller. Also, with a
controller specific response, then the slave driver is coupled to that
SPI controller which isn't great either.
Rob
Powered by blists - more mailing lists