diff options
author | Eddie James <eajames@linux.ibm.com> | 2025-01-31 14:01:58 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-02-03 19:24:44 +0000 |
commit | 652ffad172d089acb1a20e5fde1b66e687832b06 (patch) | |
tree | 8742c6c9f182ca37e356a685dbd4179b1ed11874 | |
parent | 26a756fc10fac6f133ef47f12362a39769dfe24d (diff) | |
download | linux-652ffad172d089acb1a20e5fde1b66e687832b06.tar.gz linux-652ffad172d089acb1a20e5fde1b66e687832b06.tar.bz2 linux-652ffad172d089acb1a20e5fde1b66e687832b06.zip |
spi: fsi: Batch TX operations
Batch sequential write transfers up to the max TX size (40 bytes).
This controller must specify a max transfer size of only 8 bytes for
RX operations.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://patch.msgid.link/20250131200158.732898-1-eajames@linux.ibm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-fsi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c index fc9e33be1e0e..e01c63d23b64 100644 --- a/drivers/spi/spi-fsi.c +++ b/drivers/spi/spi-fsi.c @@ -479,6 +479,19 @@ static int fsi_spi_transfer_one_message(struct spi_controller *ctlr, shift = SPI_FSI_SEQUENCE_SHIFT_IN(next->len); fsi_spi_sequence_add(&seq, shift); + } else if (next->tx_buf) { + if ((next->len + transfer->len) > (SPI_FSI_MAX_TX_SIZE + 8)) { + rc = -EINVAL; + goto error; + } + + len = next->len; + while (len > 8) { + fsi_spi_sequence_add(&seq, + SPI_FSI_SEQUENCE_SHIFT_OUT(8)); + len -= 8; + } + fsi_spi_sequence_add(&seq, SPI_FSI_SEQUENCE_SHIFT_OUT(len)); } else { next = NULL; } |