]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
spi: Provide core support for DMA mapping transfers
authorMark Brown <broonie@linaro.org>
Thu, 16 Jan 2014 12:22:43 +0000 (12:22 +0000)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:57 +0000 (21:18 -0600)
commit45cbd1f6cfb57a7c410f6d7788c3020b0be6e212
treed2908612aca4048b4c3b1c16951f33a530c0ad69
parentdac78f3126c91715a00eb9d2b23008917d6bfccd
spi: Provide core support for DMA mapping transfers

The process of DMA mapping buffers for SPI transfers does not vary between
devices so in order to save duplication of code in drivers this can be
factored out into the core, allowing it to be integrated with the work that
is being done on factoring out the common elements from the data path
including more sharing of dmaengine code.

In order to use this masters need to provide a can_dma() operation and while
the hardware is prepared they should ensure that DMA channels are provided
in tx_dma and rx_dma. The core will then ensure that the buffers are mapped
for DMA prior to calling transfer_one_message().

Currently the cleanup on error is not complete, this needs to be improved.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 99adef310f682d6343cb40c1f6c9c25a4b3a450d)
(cherry picked from commit 0f07ad70af97c144222c3d7b7cc73fa7d2f8f549)
drivers/spi/spi.c
include/linux/spi/spi.h