Skip to content

Commit 99769a5

Browse files
DhruvaG2000broonie
authored andcommitted
spi: Update the "master/slave" terminology in documentation
Update the master/slave terminology wherever possible to adopt usage of the controller/host/target. Some parts have been left untouched because they were sysfs entries and will probably end up being inaccurate if simply replaced here. Signed-off-by: Dhruva Gole <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 125b28b commit 99769a5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Documentation/spi/spi-summary.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ commonly used. Each clock cycle shifts data out and data in; the clock
1919
doesn't cycle except when there is a data bit to shift. Not all data bits
2020
are used though; not every protocol uses those full duplex capabilities.
2121

22-
SPI hosts use a fourth "chip select" line to activate a given SPI slave
22+
SPI hosts use a fourth "chip select" line to activate a given SPI target
2323
device, so those three signal wires may be connected to several chips
24-
in parallel. All SPI slaves support chipselects; they are usually active
25-
low signals, labeled nCSx for slave 'x' (e.g. nCS0). Some devices have
24+
in parallel. All SPI targets support chipselects; they are usually active
25+
low signals, labeled nCSx for target 'x' (e.g. nCS0). Some devices have
2626
other signals, often including an interrupt to the host.
2727

2828
Unlike serial busses like USB or SMBus, even low level protocols for
29-
SPI slave functions are usually not interoperable between vendors
29+
SPI target functions are usually not interoperable between vendors
3030
(except for commodities like SPI memory chips).
3131

3232
- SPI may be used for request/response style device protocols, as with
@@ -43,8 +43,8 @@ SPI slave functions are usually not interoperable between vendors
4343

4444
- Sometimes SPI is used to daisy-chain devices, like shift registers.
4545

46-
In the same way, SPI slaves will only rarely support any kind of automatic
47-
discovery/enumeration protocol. The tree of slave devices accessible from
46+
In the same way, SPI targets will only rarely support any kind of automatic
47+
discovery/enumeration protocol. The tree of target devices accessible from
4848
a given SPI host controller will normally be set up manually, with
4949
configuration tables.
5050

@@ -75,7 +75,7 @@ protocol supported by every MMC or SD memory card. (The older "DataFlash"
7575
cards, predating MMC cards but using the same connectors and card shape,
7676
support only SPI.) Some PC hardware uses SPI flash for BIOS code.
7777

78-
SPI slave chips range from digital/analog converters used for analog
78+
SPI target chips range from digital/analog converters used for analog
7979
sensors and codecs, to memory, to peripherals like USB controllers
8080
or Ethernet adapters; and more.
8181

@@ -119,7 +119,7 @@ trailing clock edge (CPHA=1), that's SPI mode 1.
119119

120120
Note that the clock mode is relevant as soon as the chipselect goes
121121
active. So the host must set the clock to inactive before selecting
122-
a slave, and the slave can tell the chosen polarity by sampling the
122+
a target, and the target can tell the chosen polarity by sampling the
123123
clock level when its select line goes active. That's why many devices
124124
support for example both modes 0 and 3: they don't care about polarity,
125125
and always clock data in/out on rising clock edges.
@@ -142,13 +142,13 @@ There are two types of SPI driver, here called:
142142

143143
Controller drivers ...
144144
controllers may be built into System-On-Chip
145-
processors, and often support both Master and Slave roles.
145+
processors, and often support both Controller and target roles.
146146
These drivers touch hardware registers and may use DMA.
147147
Or they can be PIO bitbangers, needing just GPIO pins.
148148

149149
Protocol drivers ...
150150
these pass messages through the controller
151-
driver to communicate with a Slave or Master device on the
151+
driver to communicate with a target or Controller device on the
152152
other side of an SPI link.
153153

154154
So for example one protocol driver might talk to the MTD layer to export
@@ -184,17 +184,17 @@ shows up in sysfs in several locations::
184184
MOSI, and MISO.
185185

186186
/sys/devices/.../CTLR/slave ... virtual file for (un)registering the
187-
slave device for an SPI slave controller.
188-
Writing the driver name of an SPI slave handler to this file
189-
registers the slave device; writing "(null)" unregisters the slave
187+
target device for an SPI target controller.
188+
Writing the driver name of an SPI target handler to this file
189+
registers the target device; writing "(null)" unregisters the target
190190
device.
191-
Reading from this file shows the name of the slave device ("(null)"
191+
Reading from this file shows the name of the target device ("(null)"
192192
if not registered).
193193

194194
/sys/class/spi_slave/spiB ... symlink to a logical node which could hold
195-
class related state for the SPI slave controller on bus "B". When
195+
class related state for the SPI target controller on bus "B". When
196196
registered, a single spiB.* device is present here, possible sharing
197-
the physical SPI bus segment with other SPI slave devices.
197+
the physical SPI bus segment with other SPI target devices.
198198

199199
At this time, the only class-specific state is the bus number ("B" in "spiB"),
200200
so those /sys/class entries are only useful to quickly identify busses.
@@ -270,10 +270,10 @@ same SOC controller is used. For example, on one board SPI might use
270270
an external clock, where another derives the SPI clock from current
271271
settings of some master clock.
272272

273-
Declare Slave Devices
273+
Declare target Devices
274274
^^^^^^^^^^^^^^^^^^^^^
275275

276-
The second kind of information is a list of what SPI slave devices exist
276+
The second kind of information is a list of what SPI target devices exist
277277
on the target board, often with some board-specific data needed for the
278278
driver to work correctly.
279279

@@ -469,7 +469,7 @@ routines are available to allocate and zero-initialize an spi_message
469469
with several transfers.
470470

471471

472-
How do I write an "SPI Master Controller Driver"?
472+
How do I write an "SPI Controller Driver"?
473473
-------------------------------------------------
474474
An SPI controller will probably be registered on the platform_bus; write
475475
a driver to bind to the device, whichever bus is involved.
@@ -527,7 +527,7 @@ SPI Host Controller Methods
527527
Drivers may change the defaults provided by board_info, and then
528528
call spi_setup(spi) to invoke this routine. It may sleep.
529529

530-
Unless each SPI slave has its own configuration registers, don't
530+
Unless each SPI target has its own configuration registers, don't
531531
change them right away ... otherwise drivers could corrupt I/O
532532
that's in progress for other SPI devices.
533533

0 commit comments

Comments
 (0)