From: "Nuno Sá" <noname.nuno@gmail.com>
To: Marcelo Schmitt <marcelo.schmitt@analog.com>,
broonie@kernel.org, lars@metafoo.de,
Michael.Hennerich@analog.com, jic23@kernel.org,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, nuno.sa@analog.com, dlechner@baylibre.com,
corbet@lwn.net, marcelo.schmitt1@gmail.com
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-spi@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/7] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration
Date: Wed, 26 Jun 2024 11:37:27 +0200 [thread overview]
Message-ID: <8df8f780c83a98480a3d19b0751cb96735c4adaf.camel@gmail.com> (raw)
In-Reply-To: <add14694c64b574af742a5dcd5c9461e0ef5210a.1719351923.git.marcelo.schmitt@analog.com>
On Tue, 2024-06-25 at 18:53 -0300, Marcelo Schmitt wrote:
> The behavior of an SPI controller data output line (SDO or MOSI or COPI
> (Controller Output Peripheral Input) for disambiguation) is usually not
> specified when the controller is not clocking out data on SCLK edges.
> However, there do exist SPI peripherals that require specific MOSI line
> state when data is not being clocked out of the controller.
>
> Conventional SPI controllers may set the MOSI line on SCLK edges then bring
> it low when no data is going out or leave the line the state of the last
> transfer bit. More elaborated controllers are capable to set the MOSI idle
> state according to different configurable levels and thus are more suitable
> for interfacing with demanding peripherals.
>
> Add SPI mode bits to allow peripherals to request explicit MOSI idle state
> when needed.
>
> When supporting a particular MOSI idle configuration, the data output line
> state is expected to remain at the configured level when the controller is
> not clocking out data. When a device that needs a specific MOSI idle state
> is identified, its driver should request the MOSI idle configuration by
> setting the proper SPI mode bit.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> ---
One minor nit... With that:
Acked-by: Nuno Sa <nuno.sa@analog.com>
> Documentation/spi/spi-summary.rst | 83 +++++++++++++++++++++++++++++++
> drivers/spi/spi.c | 7 +++
> include/linux/spi/spi.h | 6 +++
> include/uapi/linux/spi/spi.h | 5 +-
> 4 files changed, 99 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/spi/spi-summary.rst b/Documentation/spi/spi-
> summary.rst
> index 7f8accfae6f9..51dd8a105b7e 100644
> --- a/Documentation/spi/spi-summary.rst
> +++ b/Documentation/spi/spi-summary.rst
> @@ -614,6 +614,89 @@ queue, and then start some asynchronous transfer engine
> (unless it's
> already running).
>
>
> +Extensions to the SPI protocol
> +------------------------------
> +The fact that SPI doesn't have a formal specification or standard permits
> chip
> +manufacturers to implement the SPI protocol in slightly different ways. In
> most
> +cases, SPI protocol implementations from different vendors are compatible
> among
> +each other. For example, in SPI mode 0 (CPOL=0, CPHA=0) the bus lines may
> behave
> +like the following:
> +
> +::
> +
> + nCSx ___
> ___
> + \_________________________________________________________________/
> + • •
> + • •
> + SCLK ___ ___ ___ ___ ___ ___ ___ ___
> + _______/ \___/ \___/ \___/ \___/ \___/ \___/ \___/
> \_____
> + • : ; : ; : ; : ; : ; : ; : ; : ; •
> + • : ; : ; : ; : ; : ; : ; : ; : ; •
> + MOSI XXX__________ _______ _______
> ________XXX
> + 0xA5 XXX__/ 1 \_0_____/ 1 \_0_______0_____/ 1 \_0_____/ 1
> \_XXX
> + • ; ; ; ; ; ; ; ; •
> + • ; ; ; ; ; ; ; ; •
> + MISO XXX__________ _______________________ _______
> XXX
> + 0xBA XXX__/ 1 \_____0_/ 1 1 1 \_____0__/ 1
> \____0__XXX
> +
> +Legend::
> +
> + • marks the start/end of transmission;
> + : marks when data is clocked into the peripheral;
> + ; marks when data is clocked into the controller;
> + X marks when line states are not specified.
> +
> +In some few cases, chips extend the SPI protocol by specifying line behaviors
> +that other SPI protocols don't (e.g. data line state for when CS is
> inactive).
Forgot this one... inactive -> deasserted (or not asserted)
- Nuno Sá
next prev parent reply other threads:[~2024-06-26 9:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 21:52 [PATCH v5 0/7] Add support for AD4000 series of ADCs Marcelo Schmitt
2024-06-25 21:53 ` [PATCH v5 1/7] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration Marcelo Schmitt
2024-06-26 9:37 ` Nuno Sá [this message]
2024-06-26 14:57 ` David Lechner
2024-06-26 15:08 ` Mark Brown
2024-06-27 17:41 ` Marcelo Schmitt
2024-06-25 21:53 ` [PATCH v5 2/7] spi: bitbang: Implement support for MOSI idle state configuration Marcelo Schmitt
2024-06-26 15:01 ` David Lechner
2024-06-25 21:54 ` [PATCH v5 3/7] spi: spi-gpio: Add " Marcelo Schmitt
2024-06-26 15:02 ` David Lechner
2024-06-25 21:54 ` [PATCH v5 4/7] spi: spi-axi-spi-engine: Add support for MOSI idle configuration Marcelo Schmitt
2024-06-26 6:14 ` Alexandru Ardelean
2024-06-26 13:27 ` Marcelo Schmitt
2024-06-26 9:56 ` Nuno Sá
2024-06-26 15:06 ` David Lechner
2024-06-25 21:55 ` [PATCH v5 5/7] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-06-26 11:34 ` Conor Dooley
2024-06-26 13:34 ` Marcelo Schmitt
2024-06-26 15:55 ` Conor Dooley
2024-06-25 21:55 ` [PATCH v5 6/7] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-06-26 6:11 ` Alexandru Ardelean
2024-06-26 13:25 ` Marcelo Schmitt
2024-06-26 11:04 ` Nuno Sá
2024-06-26 13:17 ` Marcelo Schmitt
2024-06-26 13:45 ` Nuno Sá
2024-06-27 17:09 ` Marcelo Schmitt
2024-06-26 16:56 ` David Lechner
2024-06-27 23:34 ` Marcelo Schmitt
2024-06-29 18:05 ` Jonathan Cameron
2024-06-29 18:13 ` Marcelo Schmitt
2024-06-25 21:55 ` [PATCH v5 7/7] docs: iio: Add documentation " Marcelo Schmitt
2024-06-26 15:43 ` David Lechner
2024-06-28 14:40 ` Marcelo Schmitt
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=8df8f780c83a98480a3d19b0751cb96735c4adaf.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.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).