]> Git Repo - linux.git/commit
spi: bcm2835: Cache CS register value for ->prepare_message()
authorLukas Wunner <[email protected]>
Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)
committerMark Brown <[email protected]>
Wed, 11 Sep 2019 14:56:30 +0000 (15:56 +0100)
commit571e31fa60b3697d5db26140e16d5c45c51c9815
tree12c3905bb0ca9519a3e7156eaccf61f014e38181
parentc3ef8207833206f53b1ea433dc25c0c9b30d4424
spi: bcm2835: Cache CS register value for ->prepare_message()

The BCM2835 SPI driver needs to set up the clock polarity in its
->prepare_message() hook before spi_transfer_one_message() asserts chip
select to avoid a gratuitous clock signal edge (cf. commit acace73df2c1
("spi: bcm2835: set up spi-mode before asserting cs-gpio")).

Precalculate the CS register value (which selects the clock polarity)
once in ->setup() and use that cached value in ->prepare_message() and
->transfer_one().  This avoids one MMIO read per message and one per
transfer, yielding a small latency improvement.  Additionally, a
forthcoming commit will use the precalculated value to derive the
register value for clearing the RX FIFO, which will eliminate the need
for an RX dummy buffer when performing TX-only DMA transfers.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Link: https://lore.kernel.org/r/d17c1d7fcdc97fffa961b8737cfd80eeb14f9416.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
drivers/spi/spi-bcm2835.c
This page took 0.072246 seconds and 4 git commands to generate.