]> asedeno.scripts.mit.edu Git - linux.git/commit
spi: a3700: Add full-duplex support
authorMaxime Chevallier <maxime.chevallier@smile.fr>
Wed, 17 Jan 2018 16:15:28 +0000 (17:15 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 18 Jan 2018 11:10:45 +0000 (11:10 +0000)
commitf68a7dcb91b7957c5bb1c3e347775332af719519
treedff4a641266d82b96effa7e5c09a9b856377bdbb
parenta456c9320d997fdb26bfab496dd9e37f155cc788
spi: a3700: Add full-duplex support

The armada 3700 SPI controller has support for full-duplex transfers,
but it can only be done without using the hardware FIFOs.

A full duplex transfer is done by shifting 4 bytes at a time, or even
one byte at a time for transfers less than 4 bytes long.

While this method is perfectly suitable for small transfers, it is still
slower than using the FIFOs.

This commit implement full-duplex support, making sure that half-duplex
transfers are still done using the FIFOs with the existing method.

Some setup functions were moved around to make sure the controller is
properly configured before beginning each transfer.

This was tested on EspressoBin with a logical analyser, and a simple
setup where MISO is connected on MOSI. Transfers were made from
userspace using spidev and spi-pipe from the spi-tools project

Signed-off-by: Maxime Chevallier <maxime.chevallier@smile.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-armada-3700.c