]> asedeno.scripts.mit.edu Git - linux.git/commit
spi: tegra114: de-assert CS before SPI mode change
authorSowjanya Komatineni <skomatineni@nvidia.com>
Fri, 5 Apr 2019 00:14:02 +0000 (17:14 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 5 Apr 2019 02:58:57 +0000 (09:58 +0700)
commitf3e182c33e534f4caeb255a3ab927debc0d222aa
tree94f9b876b34b62d8c671ec375378f4a18b4015a0
parent1723fdec5fcbc4de3d26bbb23a9e1704ee258955
spi: tegra114: de-assert CS before SPI mode change

With SW CS, during the transfer completion CS is de-asserted by writing
default command1 register value to SPI_COMMAND1 register. With this both
mode and CS state are set at the same time and if current transfer mode
is different to default SPI mode and if mode change happens prior to CS
de-assert, clock polarity can change while CS is active before transfer
finishes.

This causes Slave to see spurious clock edges resulting in data mismatch.

This patch fixes this by de-asserting CS before writing SPI_COMMAND1 to
its default value so through out the transfer it will be in same SPI mode.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-tegra114.c