]> git.itanic.dy.fi Git - linux-stable/commit
spi: fsl-spi: Re-organise transfer bits_per_word adaptation
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 1 Apr 2023 17:59:47 +0000 (19:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:59 +0000 (11:53 +0200)
commit441fa642995a488036f3d9e67f6774a21a3d5e74
tree8e47b0ca2e9b416600bc4ea8cd8839808b74dea7
parent76ce32682635fe907e0f8e64e039e773e5c7508f
spi: fsl-spi: Re-organise transfer bits_per_word adaptation

commit 8a5299a1278eadf1e08a598a5345c376206f171e upstream.

For different reasons, fsl-spi driver performs bits_per_word
modifications for different reasons:
- On CPU mode, to minimise amount of interrupts
- On CPM/QE mode to work around controller byte order

For CPU mode that's done in fsl_spi_prepare_message() while
for CPM mode that's done in fsl_spi_setup_transfer().

Reunify all of it in fsl_spi_prepare_message(), and catch
impossible cases early through master's bits_per_word_mask
instead of returning EINVAL later.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/0ce96fe96e8b07cba0613e4097cfd94d09b8919a.1680371809.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-fsl-spi.c