]> git.baikalelectronics.ru Git - kernel.git/commit
spi: sirf: provide a shortcut for spi command-data mode
authorQipan Li <Qipan.Li@csr.com>
Sat, 1 Mar 2014 04:38:17 +0000 (12:38 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 3 Mar 2014 03:22:20 +0000 (11:22 +0800)
commite2b6d870e6ff7f7010cf8bb7eecf73afbf23b7ec
tree330b91bd194e8024559ad597b0a1c905f53168db
parent7f3ca9c0a01eb6eb69c306535b4a2169f156aba8
spi: sirf: provide a shortcut for spi command-data mode

there are many SPI clients which use the following protocal:
step 1: send command bytes to clients(rx buffer is empty)
step 2: send data bytes to clients or receive data bytes from
clients.
SiRFprimaII provides a shortcut for this kind of SPI transfer.
when tx buf is less or equal than 4 bytes and rx buf is null
in a transfer, we think it as 'command' data and use hardware
command register for the transfer.
here we can save some CPU loading than doing both tx and rx
for a normal transfer.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-sirf.c