spi: fsl-spi: Fix CPM/QE mode Litte Endian
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 1 Apr 2023 17:59:46 +0000 (19:59 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 5 Apr 2023 11:33:32 +0000 (12:33 +0100)
commitc20c57d9868d7f9fd1b2904c7801b07e128f6322
treefab449903c49484160029890fc35061b7f109131
parent43bac5158bcc5fe392a17457fda1f8e33a13e458
spi: fsl-spi: Fix CPM/QE mode Litte Endian

CPM has the same problem as QE so for CPM also use the fix added
by commit 0398fb70940e ("spi/spi_mpc8xxx: Fix QE mode Litte Endian"):

  CPM mode uses Little Endian so words > 8 bits are byte swapped.
  Workaround this by always enforcing wordsize 8 for 16 and 32 bits
  words. Unfortunately this will not work for LSB transfers
  where wordsize is > 8 bits so disable these for now.

Also limit the workaround to 16 and 32 bits words because it can
only work for multiples of 8-bits.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Fixes: 0398fb70940e ("spi/spi_mpc8xxx: Fix QE mode Litte Endian")
Link: https://lore.kernel.org/r/1b7d3e84b1128f42c1887dd2fb9cdf390f541bc1.1680371809.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-spi.c