aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-05-22 09:11:42 -0400
committerMark Brown <broonie@kernel.org>2017-05-26 08:11:00 -0400
commitaa2ea9115bc3f0735aa65b833076cc5fe3da1489 (patch)
tree2d7b5cf9a7b82e827f33828fdda83fc42e9e3e24
parent6c364062bfed3c34490e85bea52ff6e2d4f0f281 (diff)
spi: Document SPI slave controller support
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/spi/spi-summary27
1 files changed, 20 insertions, 7 deletions
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index d1824b399b2d..1721c1b570c3 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -62,8 +62,8 @@ chips described as using "three wire" signaling: SCK, data, nCSx.
62(That data line is sometimes called MOMI or SISO.) 62(That data line is sometimes called MOMI or SISO.)
63 63
64Microcontrollers often support both master and slave sides of the SPI 64Microcontrollers often support both master and slave sides of the SPI
65protocol. This document (and Linux) currently only supports the master 65protocol. This document (and Linux) supports both the master and slave
66side of SPI interactions. 66sides of SPI interactions.
67 67
68 68
69Who uses it? On what kinds of systems? 69Who uses it? On what kinds of systems?
@@ -154,9 +154,8 @@ control audio interfaces, present touchscreen sensors as input interfaces,
154or monitor temperature and voltage levels during industrial processing. 154or monitor temperature and voltage levels during industrial processing.
155And those might all be sharing the same controller driver. 155And those might all be sharing the same controller driver.
156 156
157A "struct spi_device" encapsulates the master-side interface between 157A "struct spi_device" encapsulates the controller-side interface between
158those two types of driver. At this writing, Linux has no slave side 158those two types of drivers.
159programming interface.
160 159
161There is a minimal core of SPI programming interfaces, focussing on 160There is a minimal core of SPI programming interfaces, focussing on
162using the driver model to connect controller and protocol drivers using 161using the driver model to connect controller and protocol drivers using
@@ -177,10 +176,24 @@ shows up in sysfs in several locations:
177 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices 176 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices
178 177
179 /sys/class/spi_master/spiB ... symlink (or actual device node) to 178 /sys/class/spi_master/spiB ... symlink (or actual device node) to
180 a logical node which could hold class related state for the 179 a logical node which could hold class related state for the SPI
181 controller managing bus "B". All spiB.* devices share one 180 master controller managing bus "B". All spiB.* devices share one
182 physical SPI bus segment, with SCLK, MOSI, and MISO. 181 physical SPI bus segment, with SCLK, MOSI, and MISO.
183 182
183 /sys/devices/.../CTLR/slave ... virtual file for (un)registering the
184 slave device for an SPI slave controller.
185 Writing the driver name of an SPI slave handler to this file
186 registers the slave device; writing "(null)" unregisters the slave
187 device.
188 Reading from this file shows the name of the slave device ("(null)"
189 if not registered).
190
191 /sys/class/spi_slave/spiB ... symlink (or actual device node) to
192 a logical node which could hold class related state for the SPI
193 slave controller on bus "B". When registered, a single spiB.*
194 device is present here, possible sharing the physical SPI bus
195 segment with other SPI slave devices.
196
184Note that the actual location of the controller's class state depends 197Note that the actual location of the controller's class state depends
185on whether you enabled CONFIG_SYSFS_DEPRECATED or not. At this time, 198on whether you enabled CONFIG_SYSFS_DEPRECATED or not. At this time,
186the only class-specific state is the bus number ("B" in "spiB"), so 199the only class-specific state is the bus number ("B" in "spiB"), so