]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Add poll-based SPI transfers support
authorBaikal Electronics <support@baikalelectronics.ru>
Wed, 7 Oct 2020 23:55:08 +0000 (02:55 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 8 Oct 2020 22:00:21 +0000 (23:00 +0100)
commitc9f39b46ed5139927a5ad9299e196331ee09cfa0
treecfd9ebc5b40dfa0740ea857fc079e5a96d4ee7d8
parent5c33511e2cb35fc29e118abb38b2529901eab5af
spi: dw: Add poll-based SPI transfers support

A functionality of the poll-based transfer has been removed by
commit 1ceb09717e98 ("spi: dw: remove cs_control and poll_mode members
from chip_data") with a justification that "there is no user of one
anymore". It turns out one of our DW APB SSI core is synthesized with no
IRQ line attached and the only possible way of using it is to implement a
poll-based SPI transfer procedure. So we have to get the removed
functionality back, but with some alterations described below.

First of all the poll-based transfer is activated only if the DW SPI
controller doesn't have an IRQ line attached and the Linux IRQ number is
initialized with the IRQ_NOTCONNECTED value. Secondly the transfer
procedure is now executed with a delay performed between writer and reader
methods. The delay value is calculated based on the number of data words
expected to be received on the current iteration. Finally the errors
status is checked on each iteration.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201007235511.4935-20-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-core.c