]> www.infradead.org Git - users/jedix/linux-maple.git/commit
spi: add offload TX/RX streaming APIs
authorDavid Lechner <dlechner@baylibre.com>
Fri, 7 Feb 2025 20:09:02 +0000 (14:09 -0600)
committerMark Brown <broonie@kernel.org>
Fri, 7 Feb 2025 20:17:11 +0000 (20:17 +0000)
commit700a281905f2a4ccf6f3b2d3cd6985e034b4b021
tree84046a90ee0036c8796abbbd1f2f268982c52433
parentebb398ae1e052c4245b7bcea679fe073111db2ce
spi: add offload TX/RX streaming APIs

Most configuration of SPI offloads is handled opaquely using the offload
pointer that is passed to the various offload functions. However, there
are some offload features that need to be controlled on a per transfer
basis.

This patch adds a flag field to struct spi_transfer to allow specifying
such features. The first feature to be added is the ability to stream
data to/from a hardware sink/source rather than using a tx or rx buffer.
Additional flags can be added in the future as needed.

A flags field is also added to the offload struct for providers to
indicate which flags are supported. This allows for generic checking of
offload capabilities during __spi_validate() so that each offload
provider doesn't have to implement their own validation.

As a first users of this streaming capability, getter functions are
added to get a DMA channel that is directly connected to the offload.
Peripheral drivers will use this to get a DMA channel and configure it
to suit their needs.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250207-dlech-mainline-spi-engine-offload-2-v8-5-e48a489be48c@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-offload.c
drivers/spi/spi.c
include/linux/spi/offload/consumer.h
include/linux/spi/offload/types.h
include/linux/spi/spi.h