]> git.baikalelectronics.ru Git - kernel.git/commit
spi: core: Add support for registering SPI slave controllers
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 22 May 2017 13:11:41 +0000 (15:11 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 26 May 2017 12:11:00 +0000 (13:11 +0100)
commit244e3e5d73165e9d0e9dec42ba682c60cf6b5791
tree159d6925ecfac456d6283dff5522c11e40d2ae61
parentfe79a0663ea0d68d8e7c04d51c0ed73b87a7a065
spi: core: Add support for registering SPI slave controllers

Add support for registering SPI slave controllers using the existing SPI
master framework:
  - SPI slave controllers must use spi_alloc_slave() instead of
    spi_alloc_master(), and should provide an additional callback
    "slave_abort" to abort an ongoing SPI transfer request,
  - SPI slave controllers are added to a new "spi_slave" device class,
  - SPI slave handlers can be bound to the SPI slave device represented
    by an SPI slave controller using a DT child node named "slave",
  - Alternatively, (un)binding an SPI slave handler to the SPI slave
    device represented by an SPI slave controller can be done by
    (un)registering the slave device through a sysfs virtual file named
    "slave".

From the point of view of an SPI slave protocol handler, an SPI slave
controller looks almost like an ordinary SPI master controller. The only
exception is that a transfer request will block on the remote SPI
master, and may be cancelled using spi_slave_abort().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/spi.c
include/linux/spi/spi.h