spi: axi-spi-engine: add support for any word size
authorDavid Lechner <dlechner@baylibre.com>
Fri, 17 Nov 2023 20:13:05 +0000 (14:13 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 20 Nov 2023 13:29:15 +0000 (13:29 +0000)
commitd861b417e1893a46c63cef2cb46d3587da1e5b15
tree27d008a7e5f334ff51d7376b06909e96c07b8a8b
parent145bb2aedb9f78f290c2b5503b553894a6ec53fe
spi: axi-spi-engine: add support for any word size

The AXI SPI Engine IP supports any word size from 1 to 32 bits. This
adds support for this by setting the bits_per_word_mask and emitting
the appropriate instruction to the SPI Engine each time a transfer
requires a new word size.

The functions that transfer tx/rx buffers from/to the SPI Engine
registers (spi_engine_write_{tx,rx}_fifo()) as well as the function that
creates the transfer instruction (spi_engine_gen_xfer()) also have to be
modified to take into account the word size since xfer->len is the
size of the buffers in bytes rather than words.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231117-axi-spi-engine-series-1-v1-14-cc59db999b87@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-axi-spi-engine.c