]> git.baikalelectronics.ru Git - kernel.git/commit
spi: lpspi: Add slave mode support
authorClark Wang <xiaoning.wang@nxp.com>
Fri, 7 Dec 2018 02:50:36 +0000 (02:50 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 13 Dec 2018 11:57:14 +0000 (11:57 +0000)
commitb7684b110cf42ff98c6f41810a7e667b01e06226
tree3ef7b9fb70ba6f3d9a799b4dab171a21588531cc
parentde76fba807c036f59336c7e695c39c2976ae381f
spi: lpspi: Add slave mode support

Add slave mode support to the fsl-lpspi driver, only in PIO mode.

For now, there are some limitations for slave mode transmission:
1. The stale data in RXFIFO will be dropped when the Slave does any new
   transfer.
2. One transfer can be finished only after all transfer->len data been
   transferred to master device
3. Slave device only accepts transfer->len data. Any data longer than
   this from master device will be dropped. Any data shorter than this
   from master will cause LPSPI to stuck due to mentioned limitation 2.
4. Only PIO transfer is supported in Slave Mode.

Wire connection:
GND, SCK, MISO(to MISO of slave), MOSI(to MOSI of slave), SCS

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-lpspi.c