linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt@analog.com>
Cc: <broonie@kernel.org>, <lars@metafoo.de>,
	<Michael.Hennerich@analog.com>, <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>, <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 v6 1/7] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration
Date: Sun, 30 Jun 2024 11:47:16 +0100	[thread overview]
Message-ID: <20240630114716.3e06f18b@jic23-huawei> (raw)
In-Reply-To: <7eb23146ad6bf6090183c6340e4d59cb269d83a7.1719686465.git.marcelo.schmitt@analog.com>

On Sat, 29 Jun 2024 16:04:40 -0300
Marcelo Schmitt <marcelo.schmitt@analog.com> 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.
> 
> Acked-by: Nuno Sa <nuno.sa@analog.com>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>

I always like to see some nice ascii art. Very nice documentation.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 93f59ebb5b79..c8ba5e490850 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c

> @@ -3950,6 +3956,7 @@ int spi_setup(struct spi_device *spi)
>  	 */
>  	bad_bits = spi->mode & ~(spi->controller->mode_bits | SPI_CS_WORD |
>  				 SPI_NO_TX | SPI_NO_RX);
> +

Trivial grumpy comment.  Don't touch white space in unrelated code!

>  	ugly_bits = bad_bits &
>  		    (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL |
>  		     SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL);

  reply	other threads:[~2024-06-30 10:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-29 19:04 [PATCH v6 0/7] Add support for AD4000 series of ADCs Marcelo Schmitt
2024-06-29 19:04 ` [PATCH v6 1/7] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration Marcelo Schmitt
2024-06-30 10:47   ` Jonathan Cameron [this message]
2024-07-01 17:30     ` Marcelo Schmitt
2024-07-08 21:15   ` David Lechner
2024-06-29 19:05 ` [PATCH v6 2/7] spi: bitbang: Implement support for MOSI idle state configuration Marcelo Schmitt
2024-06-30 10:52   ` Jonathan Cameron
2024-07-08 21:19   ` David Lechner
2024-06-29 19:05 ` [PATCH v6 3/7] spi: spi-gpio: Add " Marcelo Schmitt
2024-06-30 10:53   ` Jonathan Cameron
2024-06-29 19:06 ` [PATCH v6 4/7] spi: spi-axi-spi-engine: Add support for MOSI idle configuration Marcelo Schmitt
2024-06-29 19:06 ` [PATCH v6 5/7] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-06-29 19:06 ` [PATCH v6 6/7] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-06-30 11:17   ` Jonathan Cameron
2024-07-01 18:10     ` Marcelo Schmitt
2024-07-01 18:38       ` Mark Brown
2024-07-01 18:47       ` Jonathan Cameron
2024-07-08 21:34   ` David Lechner
2024-07-09  7:41   ` Nuno Sá
2024-06-29 19:07 ` [PATCH v6 7/7] docs: iio: Add documentation " Marcelo Schmitt
2024-07-08 21:25   ` David Lechner
2024-07-29 18:02 ` (subset) [PATCH v6 0/7] Add support for AD4000 series of ADCs Mark Brown
2024-07-29 19:40   ` Jonathan Cameron

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=20240630114716.3e06f18b@jic23-huawei \
    --to=jic23@kernel.org \
    --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=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).