]> git.baikalelectronics.ru Git - kernel.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)
commit08e5d6f3d795c8e9687b15b7187c79e70f438f55
treedff4a641266d82b96effa7e5c09a9b856377bdbb
parente252a7cbfe263ee3ae7d5524abf0033f95ac0b48
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