spi: spi-fsl-spi: allow changing bits_per_word while CS is still active
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 27 Mar 2019 14:30:51 +0000 (14:30 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 2 Apr 2019 06:00:54 +0000 (13:00 +0700)
commita798a7086c38d91d304132c194cff9f02197f5cd
treedf4ee1096c8dcd3ea25cfdc356184804d5f882e6
parent748fbadf951a8b32713351e10ef989181a4b47a6
spi: spi-fsl-spi: allow changing bits_per_word while CS is still active

Commit c9bfcb315104 (spi_mpc83xx: much improved driver) introduced
logic to ensure bits_per_word and speed_hz stay the same for a series
of spi_transfers with CS active, arguing that

    The current driver may cause glitches on SPI CLK line since one
    must disable the SPI controller before changing any HW settings.

This sounds quite reasonable. So this is a quite naive attempt at
relaxing this sanity checking to only ensure that speed_hz is
constant - in the faint hope that if we do not causes changes to the
clock-related fields of the SPMODE register (DIV16 and PM), those
glitches won't appear.

The purpose of this change is to allow automatically optimizing large
transfers to use 32 bits-per-word; taking one interrupt for every byte
is extremely slow.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-spi.c