]> git.baikalelectronics.ru Git - kernel.git/commit
spi: bitbang: only toggle bitchanges
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Tue, 31 Mar 2015 14:35:01 +0000 (16:35 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 31 Mar 2015 16:20:36 +0000 (17:20 +0100)
commitf21b5847242b73066e14a112aa331c2843a44883
tree3cceb6539b21681d18e64b45af556162be28e170
parent9cbe621030a9cce16d27329dac74fd4b1c1d9412
spi: bitbang: only toggle bitchanges

The current implementation of bitbang_txrx_be_cpha0 and
bitbang_txrx_be_cpha1 always call setmosi. That runs into several
unnecessary calls into the gpiolib when the level of the GPIO actually
has not to be changed.

This patch changes the routines to remember the last GPIO level
and only calls setmosi if an change has to be made. This
way it improves the transfer throughput.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bitbang-txrx.h