aboutsummaryrefslogtreecommitdiff
path: root/include/linux/spi
diff options
context:
space:
mode:
authorLeonard Göhrs2023-03-10 10:20:52 +0100
committerMark Brown2023-03-16 13:10:55 +0000
commit027781f3920ad16f40133890fc87247b8baa2d8d (patch)
tree460ff59f032b4c47ed062ad3bd6ae7f2fec253ec /include/linux/spi
parent93d205457dcda137e73dbfdcaa6a3c4c3b6d505f (diff)
spi: core: add spi_split_transfers_maxwords
Add spi_split_transfers_maxwords() function that splits spi_transfers transparently into multiple transfers that are below a given number of SPI words. This function reuses most of its code from spi_split_transfers_maxsize() and for transfers with eight or less bits per word actually behaves the same. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> Link: https://lore.kernel.org/r/20230310092053.1006459-1-l.goehrs@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 74bff5a2f53d..873ced6ae4ca 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1295,6 +1295,10 @@ extern int spi_split_transfers_maxsize(struct spi_controller *ctlr,
struct spi_message *msg,
size_t maxsize,
gfp_t gfp);
+extern int spi_split_transfers_maxwords(struct spi_controller *ctlr,
+ struct spi_message *msg,
+ size_t maxwords,
+ gfp_t gfp);
/*---------------------------------------------------------------------------*/