From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: 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,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 4/6] spi: spi-axi-spi-engine: Add support for MOSI idle configuration
Date: Wed, 19 Jun 2024 14:27:20 -0300 [thread overview]
Message-ID: <ZnMU-OUV2DCpS3mu@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <6f945701-cac0-4a56-9ca7-1daceccc5efd@baylibre.com>
On 06/19, David Lechner wrote:
> On 6/18/24 6:11 PM, Marcelo Schmitt wrote:
> > Implement MOSI idle low and MOSI idle high to better support peripherals
> > that request specific MOSI behavior.
> >
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> > drivers/spi/spi-axi-spi-engine.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
> > index 0aa31d745734..787e22ae80c0 100644
> > --- a/drivers/spi/spi-axi-spi-engine.c
> > +++ b/drivers/spi/spi-axi-spi-engine.c
> > @@ -41,6 +41,7 @@
> > #define SPI_ENGINE_CONFIG_CPHA BIT(0)
> > #define SPI_ENGINE_CONFIG_CPOL BIT(1)
> > #define SPI_ENGINE_CONFIG_3WIRE BIT(2)
> > +#define SPI_ENGINE_CONFIG_SDO_IDLE BIT(3)
>
> Calling this SPI_ENGINE_CONFIG_SDO_IDLE_HIGH would make it more
> clear what happens when the bit is enabled.
Yeah, agreed. Changing to SPI_ENGINE_CONFIG_SDO_IDLE_HIGH.
>
> >
> > #define SPI_ENGINE_INST_TRANSFER 0x0
> > #define SPI_ENGINE_INST_ASSERT 0x1
> > @@ -132,6 +133,10 @@ static unsigned int spi_engine_get_config(struct spi_device *spi)
> > config |= SPI_ENGINE_CONFIG_CPHA;
> > if (spi->mode & SPI_3WIRE)
> > config |= SPI_ENGINE_CONFIG_3WIRE;
> > + if (spi->mode & SPI_MOSI_IDLE_HIGH)
> > + config |= SPI_ENGINE_CONFIG_SDO_IDLE;
> > + if (spi->mode & SPI_MOSI_IDLE_LOW)
> > + config &= ~SPI_ENGINE_CONFIG_SDO_IDLE;
> >
> > return config;
> > }
> > @@ -646,6 +651,9 @@ static int spi_engine_probe(struct platform_device *pdev)
> >
> > host->dev.of_node = pdev->dev.of_node;
> > host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_3WIRE;
> > + if (ADI_AXI_PCORE_VER_MAJOR(version) >= 1 &&
>
> Currently, the major version is required to be 1, so this check is not
> strictly needed.
>
This is expecting the MOSI idle feature to be available on all versions from 1.3 on.
Will SPI-Engine always be major version 1?
> > + ADI_AXI_PCORE_VER_MINOR(version) >= 3)
> > + host->mode_bits |= SPI_MOSI_IDLE_LOW | SPI_MOSI_IDLE_HIGH;
>
>
>
> > host->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);
> > host->max_speed_hz = clk_get_rate(spi_engine->ref_clk) / 2;
> > host->transfer_one_message = spi_engine_transfer_one_message;
>
next prev parent reply other threads:[~2024-06-19 17:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 23:10 [PATCH v4 0/6] Add support for AD4000 series of ADCs Marcelo Schmitt
2024-06-18 23:10 ` [PATCH v4 1/6] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration Marcelo Schmitt
2024-06-19 12:07 ` Mark Brown
2024-06-19 12:42 ` Marcelo Schmitt
2024-06-19 12:42 ` Mark Brown
2024-06-19 13:53 ` David Lechner
2024-06-19 18:58 ` Marcelo Schmitt
2024-06-19 20:36 ` David Lechner
2024-06-20 15:12 ` Marcelo Schmitt
2024-06-20 15:52 ` David Lechner
2024-06-20 18:21 ` Marcelo Schmitt
2024-06-20 18:55 ` David Lechner
2024-06-19 21:29 ` Mark Brown
2024-06-20 15:14 ` Marcelo Schmitt
2024-06-19 17:24 ` David Lechner
2024-06-20 14:29 ` Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 2/6] spi: bitbang: Implement support for MOSI idle state configuration Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 3/6] spi: spi-gpio: Add " Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 4/6] spi: spi-axi-spi-engine: Add support for MOSI idle configuration Marcelo Schmitt
2024-06-19 13:56 ` David Lechner
2024-06-19 17:27 ` Marcelo Schmitt [this message]
2024-06-19 18:20 ` David Lechner
2024-06-18 23:12 ` [PATCH v4 5/6] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-06-19 13:13 ` David Lechner
2024-06-19 17:04 ` Marcelo Schmitt
2024-06-19 19:57 ` David Lechner
2024-06-18 23:12 ` [PATCH v4 6/6] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-06-19 17:02 ` David Lechner
2024-06-20 20:08 ` Jonathan Cameron
2024-06-20 20:02 ` 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=ZnMU-OUV2DCpS3mu@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--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-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--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