Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: split up serial-interfaces.rst

It never made sense to keep these documents together; move each into its
own file.

Drop the section numbering on hsi.txt on its way to its own file.

Suggested-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

+190 -190
+88
Documentation/driver-api/hsi.rst
··· 1 + High Speed Synchronous Serial Interface (HSI) 2 + ============================================= 3 + 4 + Introduction 5 + --------------- 6 + 7 + High Speed Syncronous Interface (HSI) is a fullduplex, low latency protocol, 8 + that is optimized for die-level interconnect between an Application Processor 9 + and a Baseband chipset. It has been specified by the MIPI alliance in 2003 and 10 + implemented by multiple vendors since then. 11 + 12 + The HSI interface supports full duplex communication over multiple channels 13 + (typically 8) and is capable of reaching speeds up to 200 Mbit/s. 14 + 15 + The serial protocol uses two signals, DATA and FLAG as combined data and clock 16 + signals and an additional READY signal for flow control. An additional WAKE 17 + signal can be used to wakeup the chips from standby modes. The signals are 18 + commonly prefixed by AC for signals going from the application die to the 19 + cellular die and CA for signals going the other way around. 20 + 21 + :: 22 + 23 + +------------+ +---------------+ 24 + | Cellular | | Application | 25 + | Die | | Die | 26 + | | - - - - - - CAWAKE - - - - - - >| | 27 + | T|------------ CADATA ------------>|R | 28 + | X|------------ CAFLAG ------------>|X | 29 + | |<----------- ACREADY ------------| | 30 + | | | | 31 + | | | | 32 + | |< - - - - - ACWAKE - - - - - - -| | 33 + | R|<----------- ACDATA -------------|T | 34 + | X|<----------- ACFLAG -------------|X | 35 + | |------------ CAREADY ----------->| | 36 + | | | | 37 + | | | | 38 + +------------+ +---------------+ 39 + 40 + HSI Subsystem in Linux 41 + ------------------------- 42 + 43 + In the Linux kernel the hsi subsystem is supposed to be used for HSI devices. 44 + The hsi subsystem contains drivers for hsi controllers including support for 45 + multi-port controllers and provides a generic API for using the HSI ports. 46 + 47 + It also contains HSI client drivers, which make use of the generic API to 48 + implement a protocol used on the HSI interface. These client drivers can 49 + use an arbitrary number of channels. 50 + 51 + hsi-char Device 52 + ------------------ 53 + 54 + Each port automatically registers a generic client driver called hsi_char, 55 + which provides a charecter device for userspace representing the HSI port. 56 + It can be used to communicate via HSI from userspace. Userspace may 57 + configure the hsi_char device using the following ioctl commands: 58 + 59 + HSC_RESET 60 + flush the HSI port 61 + 62 + HSC_SET_PM 63 + enable or disable the client. 64 + 65 + HSC_SEND_BREAK 66 + send break 67 + 68 + HSC_SET_RX 69 + set RX configuration 70 + 71 + HSC_GET_RX 72 + get RX configuration 73 + 74 + HSC_SET_TX 75 + set TX configuration 76 + 77 + HSC_GET_TX 78 + get TX configuration 79 + 80 + The kernel HSI API 81 + ------------------ 82 + 83 + .. kernel-doc:: include/linux/hsi/hsi.h 84 + :internal: 85 + 86 + .. kernel-doc:: drivers/hsi/hsi_core.c 87 + :export: 88 +
+46
Documentation/driver-api/i2c.rst
··· 1 + I\ :sup:`2`\ C and SMBus Subsystem 2 + ================================== 3 + 4 + I\ :sup:`2`\ C (or without fancy typography, "I2C") is an acronym for 5 + the "Inter-IC" bus, a simple bus protocol which is widely used where low 6 + data rate communications suffice. Since it's also a licensed trademark, 7 + some vendors use another name (such as "Two-Wire Interface", TWI) for 8 + the same bus. I2C only needs two signals (SCL for clock, SDA for data), 9 + conserving board real estate and minimizing signal quality issues. Most 10 + I2C devices use seven bit addresses, and bus speeds of up to 400 kHz; 11 + there's a high speed extension (3.4 MHz) that's not yet found wide use. 12 + I2C is a multi-master bus; open drain signaling is used to arbitrate 13 + between masters, as well as to handshake and to synchronize clocks from 14 + slower clients. 15 + 16 + The Linux I2C programming interfaces support only the master side of bus 17 + interactions, not the slave side. The programming interface is 18 + structured around two kinds of driver, and two kinds of device. An I2C 19 + "Adapter Driver" abstracts the controller hardware; it binds to a 20 + physical device (perhaps a PCI device or platform_device) and exposes a 21 + :c:type:`struct i2c_adapter <i2c_adapter>` representing each 22 + I2C bus segment it manages. On each I2C bus segment will be I2C devices 23 + represented by a :c:type:`struct i2c_client <i2c_client>`. 24 + Those devices will be bound to a :c:type:`struct i2c_driver 25 + <i2c_driver>`, which should follow the standard Linux driver 26 + model. (At this writing, a legacy model is more widely used.) There are 27 + functions to perform various I2C protocol operations; at this writing 28 + all such functions are usable only from task context. 29 + 30 + The System Management Bus (SMBus) is a sibling protocol. Most SMBus 31 + systems are also I2C conformant. The electrical constraints are tighter 32 + for SMBus, and it standardizes particular protocol messages and idioms. 33 + Controllers that support I2C can also support most SMBus operations, but 34 + SMBus controllers don't support all the protocol options that an I2C 35 + controller will. There are functions to perform various SMBus protocol 36 + operations, either using I2C primitives or by issuing SMBus commands to 37 + i2c_adapter devices which don't support those I2C operations. 38 + 39 + .. kernel-doc:: include/linux/i2c.h 40 + :internal: 41 + 42 + .. kernel-doc:: drivers/i2c/i2c-boardinfo.c 43 + :functions: i2c_register_board_info 44 + 45 + .. kernel-doc:: drivers/i2c/i2c-core.c 46 + :export:
+3 -1
Documentation/driver-api/index.rst
··· 20 20 sound 21 21 frame-buffer 22 22 input 23 - serial-interfaces 23 + spi 24 + i2c 25 + hsi 24 26 miscellaneous
-189
Documentation/driver-api/serial-interfaces.rst
··· 1 - Serial Peripheral Interface (SPI) 2 - ================================= 3 - 4 - SPI is the "Serial Peripheral Interface", widely used with embedded 5 - systems because it is a simple and efficient interface: basically a 6 - multiplexed shift register. Its three signal wires hold a clock (SCK, 7 - often in the range of 1-20 MHz), a "Master Out, Slave In" (MOSI) data 8 - line, and a "Master In, Slave Out" (MISO) data line. SPI is a full 9 - duplex protocol; for each bit shifted out the MOSI line (one per clock) 10 - another is shifted in on the MISO line. Those bits are assembled into 11 - words of various sizes on the way to and from system memory. An 12 - additional chipselect line is usually active-low (nCS); four signals are 13 - normally used for each peripheral, plus sometimes an interrupt. 14 - 15 - The SPI bus facilities listed here provide a generalized interface to 16 - declare SPI busses and devices, manage them according to the standard 17 - Linux driver model, and perform input/output operations. At this time, 18 - only "master" side interfaces are supported, where Linux talks to SPI 19 - peripherals and does not implement such a peripheral itself. (Interfaces 20 - to support implementing SPI slaves would necessarily look different.) 21 - 22 - The programming interface is structured around two kinds of driver, and 23 - two kinds of device. A "Controller Driver" abstracts the controller 24 - hardware, which may be as simple as a set of GPIO pins or as complex as 25 - a pair of FIFOs connected to dual DMA engines on the other side of the 26 - SPI shift register (maximizing throughput). Such drivers bridge between 27 - whatever bus they sit on (often the platform bus) and SPI, and expose 28 - the SPI side of their device as a :c:type:`struct spi_master 29 - <spi_master>`. SPI devices are children of that master, 30 - represented as a :c:type:`struct spi_device <spi_device>` and 31 - manufactured from :c:type:`struct spi_board_info 32 - <spi_board_info>` descriptors which are usually provided by 33 - board-specific initialization code. A :c:type:`struct spi_driver 34 - <spi_driver>` is called a "Protocol Driver", and is bound to a 35 - spi_device using normal driver model calls. 36 - 37 - The I/O model is a set of queued messages. Protocol drivers submit one 38 - or more :c:type:`struct spi_message <spi_message>` objects, 39 - which are processed and completed asynchronously. (There are synchronous 40 - wrappers, however.) Messages are built from one or more 41 - :c:type:`struct spi_transfer <spi_transfer>` objects, each of 42 - which wraps a full duplex SPI transfer. A variety of protocol tweaking 43 - options are needed, because different chips adopt very different 44 - policies for how they use the bits transferred with SPI. 45 - 46 - .. kernel-doc:: include/linux/spi/spi.h 47 - :internal: 48 - 49 - .. kernel-doc:: drivers/spi/spi.c 50 - :functions: spi_register_board_info 51 - 52 - .. kernel-doc:: drivers/spi/spi.c 53 - :export: 54 - 55 - I\ :sup:`2`\ C and SMBus Subsystem 56 - ================================== 57 - 58 - I\ :sup:`2`\ C (or without fancy typography, "I2C") is an acronym for 59 - the "Inter-IC" bus, a simple bus protocol which is widely used where low 60 - data rate communications suffice. Since it's also a licensed trademark, 61 - some vendors use another name (such as "Two-Wire Interface", TWI) for 62 - the same bus. I2C only needs two signals (SCL for clock, SDA for data), 63 - conserving board real estate and minimizing signal quality issues. Most 64 - I2C devices use seven bit addresses, and bus speeds of up to 400 kHz; 65 - there's a high speed extension (3.4 MHz) that's not yet found wide use. 66 - I2C is a multi-master bus; open drain signaling is used to arbitrate 67 - between masters, as well as to handshake and to synchronize clocks from 68 - slower clients. 69 - 70 - The Linux I2C programming interfaces support only the master side of bus 71 - interactions, not the slave side. The programming interface is 72 - structured around two kinds of driver, and two kinds of device. An I2C 73 - "Adapter Driver" abstracts the controller hardware; it binds to a 74 - physical device (perhaps a PCI device or platform_device) and exposes a 75 - :c:type:`struct i2c_adapter <i2c_adapter>` representing each 76 - I2C bus segment it manages. On each I2C bus segment will be I2C devices 77 - represented by a :c:type:`struct i2c_client <i2c_client>`. 78 - Those devices will be bound to a :c:type:`struct i2c_driver 79 - <i2c_driver>`, which should follow the standard Linux driver 80 - model. (At this writing, a legacy model is more widely used.) There are 81 - functions to perform various I2C protocol operations; at this writing 82 - all such functions are usable only from task context. 83 - 84 - The System Management Bus (SMBus) is a sibling protocol. Most SMBus 85 - systems are also I2C conformant. The electrical constraints are tighter 86 - for SMBus, and it standardizes particular protocol messages and idioms. 87 - Controllers that support I2C can also support most SMBus operations, but 88 - SMBus controllers don't support all the protocol options that an I2C 89 - controller will. There are functions to perform various SMBus protocol 90 - operations, either using I2C primitives or by issuing SMBus commands to 91 - i2c_adapter devices which don't support those I2C operations. 92 - 93 - .. kernel-doc:: include/linux/i2c.h 94 - :internal: 95 - 96 - .. kernel-doc:: drivers/i2c/i2c-boardinfo.c 97 - :functions: i2c_register_board_info 98 - 99 - .. kernel-doc:: drivers/i2c/i2c-core.c 100 - :export: 101 - 102 - High Speed Synchronous Serial Interface (HSI) 103 - ============================================= 104 - 105 - 1. Introduction 106 - --------------- 107 - 108 - High Speed Syncronous Interface (HSI) is a fullduplex, low latency protocol, 109 - that is optimized for die-level interconnect between an Application Processor 110 - and a Baseband chipset. It has been specified by the MIPI alliance in 2003 and 111 - implemented by multiple vendors since then. 112 - 113 - The HSI interface supports full duplex communication over multiple channels 114 - (typically 8) and is capable of reaching speeds up to 200 Mbit/s. 115 - 116 - The serial protocol uses two signals, DATA and FLAG as combined data and clock 117 - signals and an additional READY signal for flow control. An additional WAKE 118 - signal can be used to wakeup the chips from standby modes. The signals are 119 - commonly prefixed by AC for signals going from the application die to the 120 - cellular die and CA for signals going the other way around. 121 - 122 - :: 123 - 124 - +------------+ +---------------+ 125 - | Cellular | | Application | 126 - | Die | | Die | 127 - | | - - - - - - CAWAKE - - - - - - >| | 128 - | T|------------ CADATA ------------>|R | 129 - | X|------------ CAFLAG ------------>|X | 130 - | |<----------- ACREADY ------------| | 131 - | | | | 132 - | | | | 133 - | |< - - - - - ACWAKE - - - - - - -| | 134 - | R|<----------- ACDATA -------------|T | 135 - | X|<----------- ACFLAG -------------|X | 136 - | |------------ CAREADY ----------->| | 137 - | | | | 138 - | | | | 139 - +------------+ +---------------+ 140 - 141 - 2. HSI Subsystem in Linux 142 - ------------------------- 143 - 144 - In the Linux kernel the hsi subsystem is supposed to be used for HSI devices. 145 - The hsi subsystem contains drivers for hsi controllers including support for 146 - multi-port controllers and provides a generic API for using the HSI ports. 147 - 148 - It also contains HSI client drivers, which make use of the generic API to 149 - implement a protocol used on the HSI interface. These client drivers can 150 - use an arbitrary number of channels. 151 - 152 - 3. hsi-char Device 153 - ------------------ 154 - 155 - Each port automatically registers a generic client driver called hsi_char, 156 - which provides a charecter device for userspace representing the HSI port. 157 - It can be used to communicate via HSI from userspace. Userspace may 158 - configure the hsi_char device using the following ioctl commands: 159 - 160 - HSC_RESET 161 - flush the HSI port 162 - 163 - HSC_SET_PM 164 - enable or disable the client. 165 - 166 - HSC_SEND_BREAK 167 - send break 168 - 169 - HSC_SET_RX 170 - set RX configuration 171 - 172 - HSC_GET_RX 173 - get RX configuration 174 - 175 - HSC_SET_TX 176 - set TX configuration 177 - 178 - HSC_GET_TX 179 - get TX configuration 180 - 181 - The kernel HSI API 182 - ------------------ 183 - 184 - .. kernel-doc:: include/linux/hsi/hsi.h 185 - :internal: 186 - 187 - .. kernel-doc:: drivers/hsi/hsi_core.c 188 - :export: 189 -
+53
Documentation/driver-api/spi.rst
··· 1 + Serial Peripheral Interface (SPI) 2 + ================================= 3 + 4 + SPI is the "Serial Peripheral Interface", widely used with embedded 5 + systems because it is a simple and efficient interface: basically a 6 + multiplexed shift register. Its three signal wires hold a clock (SCK, 7 + often in the range of 1-20 MHz), a "Master Out, Slave In" (MOSI) data 8 + line, and a "Master In, Slave Out" (MISO) data line. SPI is a full 9 + duplex protocol; for each bit shifted out the MOSI line (one per clock) 10 + another is shifted in on the MISO line. Those bits are assembled into 11 + words of various sizes on the way to and from system memory. An 12 + additional chipselect line is usually active-low (nCS); four signals are 13 + normally used for each peripheral, plus sometimes an interrupt. 14 + 15 + The SPI bus facilities listed here provide a generalized interface to 16 + declare SPI busses and devices, manage them according to the standard 17 + Linux driver model, and perform input/output operations. At this time, 18 + only "master" side interfaces are supported, where Linux talks to SPI 19 + peripherals and does not implement such a peripheral itself. (Interfaces 20 + to support implementing SPI slaves would necessarily look different.) 21 + 22 + The programming interface is structured around two kinds of driver, and 23 + two kinds of device. A "Controller Driver" abstracts the controller 24 + hardware, which may be as simple as a set of GPIO pins or as complex as 25 + a pair of FIFOs connected to dual DMA engines on the other side of the 26 + SPI shift register (maximizing throughput). Such drivers bridge between 27 + whatever bus they sit on (often the platform bus) and SPI, and expose 28 + the SPI side of their device as a :c:type:`struct spi_master 29 + <spi_master>`. SPI devices are children of that master, 30 + represented as a :c:type:`struct spi_device <spi_device>` and 31 + manufactured from :c:type:`struct spi_board_info 32 + <spi_board_info>` descriptors which are usually provided by 33 + board-specific initialization code. A :c:type:`struct spi_driver 34 + <spi_driver>` is called a "Protocol Driver", and is bound to a 35 + spi_device using normal driver model calls. 36 + 37 + The I/O model is a set of queued messages. Protocol drivers submit one 38 + or more :c:type:`struct spi_message <spi_message>` objects, 39 + which are processed and completed asynchronously. (There are synchronous 40 + wrappers, however.) Messages are built from one or more 41 + :c:type:`struct spi_transfer <spi_transfer>` objects, each of 42 + which wraps a full duplex SPI transfer. A variety of protocol tweaking 43 + options are needed, because different chips adopt very different 44 + policies for how they use the bits transferred with SPI. 45 + 46 + .. kernel-doc:: include/linux/spi/spi.h 47 + :internal: 48 + 49 + .. kernel-doc:: drivers/spi/spi.c 50 + :functions: spi_register_board_info 51 + 52 + .. kernel-doc:: drivers/spi/spi.c 53 + :export: