spi: Provide core support for full duplex devices
authorMark Brown <broonie@linaro.org>
Tue, 28 Jan 2014 20:17:03 +0000 (20:17 +0000)
committerMark Brown <broonie@linaro.org>
Tue, 4 Feb 2014 20:31:33 +0000 (20:31 +0000)
commit3a2eba9bd0a6447dfbc01635e4cd0689f5f2bdad
tree642ccd6b3b125435d4e6efa2dce51e2ccb34c485
parent3700c6eb1e41a898c35c8dd4d5b10dc65fdaf486
spi: Provide core support for full duplex devices

It is fairly common for SPI devices to require that one or both transfer
directions is always active. Currently drivers open code this in various
ways with varying degrees of efficiency. Start factoring this out by
providing flags SPI_MASTER_MUST_TX and SPI_MASTER_MUST_RX. These will cause
the core to provide buffers for the requested direction if none are
specified in the underlying transfer.

Currently this is fairly inefficient since we actually allocate a data
buffer which may get large, support for mapping transfers using a
scatterlist will allow us to avoid this for DMA based transfers.

Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c
include/linux/spi/spi.h