From: Valentin Caron <valentin.caron@foss.st.com>
To: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alain Volmat <alain.volmat@foss.st.com>
Cc: <linux-spi@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Valentin Caron <valentin.caron@foss.st.com>
Subject: [PATCH 6/7] dt-bindings: spi: stm32: add stm32h7 st,spi-slave-underrun property
Date: Fri, 28 Apr 2023 14:15:23 +0200	[thread overview]
Message-ID: <20230428121524.2125832-7-valentin.caron@foss.st.com> (raw)
In-Reply-To: <20230428121524.2125832-1-valentin.caron@foss.st.com>
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@foss.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.
+
 patternProperties:
   "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-f]+$":
     type: object
diff --git a/MAINTAINERS b/MAINTAINERS
index 007a9cdb9cc8..9dcf861834fd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19790,6 +19790,7 @@ M:	Alain Volmat <alain.volmat@foss.st.com>
 L:	linux-spi@vger.kernel.org
 S:	Maintained
 F:	drivers/spi/spi-stm32.c
+F:	include/dt-bindings/spi/spi-stm32.h
 
 ST STPDDC60 DRIVER
 M:	Daniel Nilsson <daniel.nilsson@flex.com>
diff --git a/include/dt-bindings/spi/spi-stm32.h b/include/dt-bindings/spi/spi-stm32.h
new file mode 100644
index 000000000000..260109fd1631
--- /dev/null
+++ b/include/dt-bindings/spi/spi-stm32.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) */
+/*
+ * This header provides constants for STM32_SPI bindings.
+ */
+
+#ifndef _DT_BINDINGS_SPI_SPI_STM32_H
+#define _DT_BINDINGS_SPI_SPI_STM32_H
+
+/* st,spi-slave-underrun first parameter */
+#define SPI_NO_ACTION			        0
+#define SPI_SEND_PATTERN		        1
+#define SPI_REPEAT_LAST_RECEIVED_DATA	        2
+#define SPI_REPEAT_LAST_TRANSMITTED_DATA        3
+
+#endif
-- 
2.25.1
next prev parent reply	other threads:[~2023-04-28 12:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28 12:15 [PATCH 0/7] spi: stm32: add spi slave mode Valentin Caron
2023-04-28 12:15 ` [PATCH 1/7] dt-bindings: spi: stm32: add address-cells and size-cells into yaml Valentin Caron
2023-04-28 21:41   ` Rob Herring
2023-05-04 17:09     ` Valentin CARON
2023-04-28 12:15 ` [PATCH 2/7] spi: stm32: renaming of spi_master into spi_controller Valentin Caron
2023-04-28 12:15 ` [PATCH 3/7] spi: stm32: use dmaengine_terminate_{a}sync instead of _all Valentin Caron
2023-04-28 12:15 ` [PATCH 4/7] dt-bindings: spi: stm32: add bindings regarding stm32h7 spi slave Valentin Caron
2023-04-28 21:46   ` Rob Herring
2023-05-04 17:11     ` Valentin CARON
2023-04-28 12:15 ` [PATCH 5/7] spi: stm32: introduction of stm32h7 SPI slave support Valentin Caron
2023-04-28 12:15 ` Valentin Caron [this message]
2023-04-28 21:56   ` [PATCH 6/7] dt-bindings: spi: stm32: add stm32h7 st,spi-slave-underrun property Rob Herring
2023-05-04 17:13     ` Valentin CARON
2023-04-28 12:15 ` [PATCH 7/7] spi: stm32: add support for stm32h7 SPI slave underrun detection Valentin Caron
2023-05-02  7:20   ` Alain Volmat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20230428121524.2125832-7-valentin.caron@foss.st.com \
    --to=valentin.caron@foss.st.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).