spi: gpio: Implement LSB First bitbang support
authorAndreas Färber <afaerber@suse.de>
Sat, 19 Feb 2022 13:15:48 +0000 (14:15 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 22 Feb 2022 11:56:41 +0000 (11:56 +0000)
commit1847e3046c528bd85bd51e2860f4139bd9052d6c
treeb5384060b3dec3f43071d118d36185cf6f3fe9e5
parent5741150c808b2bbeb1017609f3029daf6651b7d5
spi: gpio: Implement LSB First bitbang support

Add support for slave DT property spi-lsb-first, i.e., SPI_LSB_FIRST mode.
Duplicate the inline helpers bitbang_txrx_be_cpha{0,1} as LE versions.
Conditionally call them from all the spi-gpio txrx_word callbacks.

Some alternatives to this implementation approach were discussed back
then [0], but eventually it was considered reasonable.

[0] https://lore.kernel.org/linux-arm-kernel/20191212033952.5967-8-afaerber@suse.de/

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://lore.kernel.org/r/feac3377-4ad1-77d8-9a18-3588d80fb909@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bitbang-txrx.h
drivers/spi/spi-gpio.c