diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-05-22 09:11:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-05-26 08:11:00 -0400 |
commit | aa2ea9115bc3f0735aa65b833076cc5fe3da1489 (patch) | |
tree | 2d7b5cf9a7b82e827f33828fdda83fc42e9e3e24 | |
parent | 6c364062bfed3c34490e85bea52ff6e2d4f0f281 (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-summary | 27 |
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 | ||
64 | Microcontrollers often support both master and slave sides of the SPI | 64 | Microcontrollers often support both master and slave sides of the SPI |
65 | protocol. This document (and Linux) currently only supports the master | 65 | protocol. This document (and Linux) supports both the master and slave |
66 | side of SPI interactions. | 66 | sides of SPI interactions. |
67 | 67 | ||
68 | 68 | ||
69 | Who uses it? On what kinds of systems? | 69 | Who uses it? On what kinds of systems? |
@@ -154,9 +154,8 @@ control audio interfaces, present touchscreen sensors as input interfaces, | |||
154 | or monitor temperature and voltage levels during industrial processing. | 154 | or monitor temperature and voltage levels during industrial processing. |
155 | And those might all be sharing the same controller driver. | 155 | And those might all be sharing the same controller driver. |
156 | 156 | ||
157 | A "struct spi_device" encapsulates the master-side interface between | 157 | A "struct spi_device" encapsulates the controller-side interface between |
158 | those two types of driver. At this writing, Linux has no slave side | 158 | those two types of drivers. |
159 | programming interface. | ||
160 | 159 | ||
161 | There is a minimal core of SPI programming interfaces, focussing on | 160 | There is a minimal core of SPI programming interfaces, focussing on |
162 | using the driver model to connect controller and protocol drivers using | 161 | using 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 | |||
184 | Note that the actual location of the controller's class state depends | 197 | Note that the actual location of the controller's class state depends |
185 | on whether you enabled CONFIG_SYSFS_DEPRECATED or not. At this time, | 198 | on whether you enabled CONFIG_SYSFS_DEPRECATED or not. At this time, |
186 | the only class-specific state is the bus number ("B" in "spiB"), so | 199 | the only class-specific state is the bus number ("B" in "spiB"), so |