spi: rspi: Use core SPI_MASTER_MUST_[RT]X handling
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 2 Jun 2014 13:38:06 +0000 (15:38 +0200)
committerSimon Horman <horms@verge.net.au>
Fri, 5 Dec 2014 00:23:03 +0000 (09:23 +0900)
commit043a178656fa104f733f9c952cb6981e04856441
tree5eb63588feb1aac7999e24f418e50018a00658cf
parente880244540c86c98f857da94d4e502fe3e1f6b6f
spi: rspi: Use core SPI_MASTER_MUST_[RT]X handling

RSPI needs dummy transfers to generate the SPI clock on receive.
RSPI-RZ and QSPI always do both transmit and receive.

Use the SPI core SPI_MASTER_MUST_RX/SPI_MASTER_MUST_TX infrastructure
instead of checking for the presence of buffers and providing dummy data
ourselves (for PIO), or providing a dummy buffer (for DMA).

rspi_receive_dma() now provides full duplex DMA transfers on RSPI, and is
renamed to rspi_send_receive_dma().

As the SPI core will always provide a TX buffer, the logic to choose
between DMA send and DMA send/receive in rspi_transfer_one() now has to
check for the presence of an RX buffer. Likewise for the DMA availability
tests in rspi_is_dma().

The buffer tests in qspi_transfer_one() are now always true, so they're
removed.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b42e03596db3d45980c976c8124fdc323f031dc4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/spi/spi-rspi.c