]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3fad56b503a181bcf18bce3d36b513a1bd2cce26
treedf4ee1096c8dcd3ea25cfdc356184804d5f882e6
parent183c555c402bb13b60e83bb6af7a888c7f8cda14
spi: spi-fsl-spi: allow changing bits_per_word while CS is still active

Commit 9a48a70996f9 (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