Linux userland API discussions
 help / color / mirror / Atom feed
From: Cheng Ming Lin <linchengming884@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-api@vger.kernel.org,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	alvinzhou@mxic.com.tw
Subject: [PATCH v2 3/3] spi: spidev: Document SPI_IOC_MESSAGE_FLAGS
Date: Tue,  1 Dec 2026 14:52:02 +0800	[thread overview]
Message-ID: <20261201065202.2667609-4-chengminglin@mxic.com.tw> (raw)
In-Reply-To: <20261201065202.2667609-1-chengminglin@mxic.com.tw>

Describe the flags field of struct spi_ioc_transfer, SPI_IOC_XFER_DTR
and the SPI_IOC_MESSAGE_FLAGS request, including how it differs from
SPI_IOC_MESSAGE and how it fails on unsupported controllers and older
kernels.

Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
 Documentation/spi/spidev.rst | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/spi/spidev.rst b/Documentation/spi/spidev.rst
index e08b301ad..5595629c2 100644
--- a/Documentation/spi/spidev.rst
+++ b/Documentation/spi/spidev.rst
@@ -112,7 +112,7 @@ would expect.
 Standard read() and write() operations are obviously only half-duplex, and
 the chipselect is deactivated between those operations.  Full-duplex access,
 and composite operation without chipselect de-activation, is available using
-the SPI_IOC_MESSAGE(N) request.
+the SPI_IOC_MESSAGE(N) and SPI_IOC_MESSAGE_FLAGS(N) requests.
 
 Several ioctl() requests let your driver read or override the device's current
 settings for data transfer parameters:
@@ -189,3 +189,11 @@ and bitrate for each transfer segment.)
 
 To make a full duplex request, provide both rx_buf and tx_buf for the
 same transfer.  It's even OK if those are the same buffer.
+
+Each transfer can also request a Double Transfer Rate (DTR) transfer by
+setting SPI_IOC_XFER_DTR in the flags field of struct spi_ioc_transfer.
+The flags field is only honoured by the SPI_IOC_MESSAGE_FLAGS(N) request,
+which otherwise behaves like SPI_IOC_MESSAGE(N); SPI_IOC_MESSAGE(N) ignores
+it.  SPI_IOC_MESSAGE_FLAGS(N) fails with EINVAL if a transfer sets an
+unknown flag or requests DTR from a controller that does not support it,
+and with ENOTTY on kernels that do not support the request.
-- 
2.25.1


      parent reply	other threads:[~2026-12-01  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  6:51 [PATCH v2 0/3] spi: spidev: Allow userspace to request DTR transfers Cheng Ming Lin
2026-12-01  6:52 ` [PATCH v2 1/3] " Cheng Ming Lin
2026-12-01  6:52 ` [PATCH v2 2/3] spi: spidev_test: Add an option " Cheng Ming Lin
2026-12-01  6:52 ` Cheng Ming Lin [this message]

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=20261201065202.2667609-4-chengminglin@mxic.com.tw \
    --to=linchengming884@gmail.com \
    --cc=alvinzhou@mxic.com.tw \
    --cc=broonie@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    /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