Luca Ceresoli | f6fcefa | 2020-01-29 16:19:51 +0100 | [diff] [blame] | 1 | ================== |
| 2 | The SMBus Protocol |
| 3 | ================== |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 4 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | The following is a summary of the SMBus protocol. It applies to |
| 6 | all revisions of the protocol (1.0, 1.1, and 2.0). |
| 7 | Certain protocol features which are not supported by |
| 8 | this package are briefly described at the end of this document. |
| 9 | |
| 10 | Some adapters understand only the SMBus (System Management Bus) protocol, |
| 11 | which is a subset from the I2C protocol. Fortunately, many devices use |
| 12 | only the same subset, which makes it possible to put them on an SMBus. |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | If you write a driver for some I2C device, please try to use the SMBus |
| 15 | commands if at all possible (if the device uses only that subset of the |
| 16 | I2C protocol). This makes it possible to use the device driver on both |
| 17 | SMBus adapters and I2C adapters (the SMBus command set is automatically |
| 18 | translated to I2C on I2C adapters, but plain I2C commands can not be |
| 19 | handled at all on most pure SMBus adapters). |
| 20 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 21 | Below is a list of SMBus protocol operations, and the functions executing |
| 22 | them. Note that the names used in the SMBus protocol specifications usually |
| 23 | don't match these function names. For some of the operations which pass a |
| 24 | single data byte, the functions using SMBus protocol operation names execute |
| 25 | a different protocol operation entirely. |
| 26 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 27 | Each transaction type corresponds to a functionality flag. Before calling a |
| 28 | transaction function, a device driver should always check (just once) for |
| 29 | the corresponding functionality flag to ensure that the underlying I2C |
Luca Ceresoli | 924fbb4 | 2020-01-29 16:19:36 +0100 | [diff] [blame] | 30 | adapter supports the transaction in question. See :doc:`functionality` for |
| 31 | the details. |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| 34 | Key to symbols |
| 35 | ============== |
| 36 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 37 | =============== ============================================================= |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 38 | S Start condition |
| 39 | P Stop condition |
| 40 | Rd/Wr (1 bit) Read/Write bit. Rd equals 1, Wr equals 0. |
Luca Ceresoli | 9e89d61 | 2020-01-29 16:19:39 +0100 | [diff] [blame] | 41 | A, NA (1 bit) Acknowledge (ACK) and Not Acknowledge (NACK) bit |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 42 | Addr (7 bits) I2C 7 bit address. Note that this can be expanded as usual to |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | get a 10 bit I2C address. |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 44 | Comm (8 bits) Command byte, a data byte which often selects a register on |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | the device. |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 46 | Data (8 bits) A plain data byte. Sometimes, I write DataLow, DataHigh |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | for 16 bit data. |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 48 | Count (8 bits) A data byte containing the length of a block operation. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
Luca Ceresoli | 026c0fe | 2020-01-29 16:19:38 +0100 | [diff] [blame] | 50 | [..] Data sent by I2C device, as opposed to data sent by the host |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 51 | adapter. |
| 52 | =============== ============================================================= |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
| 54 | |
Jean Delvare | 67c2e66 | 2008-07-14 22:38:23 +0200 | [diff] [blame] | 55 | SMBus Quick Command |
| 56 | =================== |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 58 | This sends a single bit to the device, at the place of the Rd/Wr bit:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Daniel Schaefer | a576512 | 2020-06-14 20:23:55 +0200 | [diff] [blame] | 60 | S Addr Rd/Wr [A] P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 62 | Functionality flag: I2C_FUNC_SMBUS_QUICK |
| 63 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 65 | SMBus Receive Byte |
| 66 | ================== |
| 67 | |
| 68 | Implemented by i2c_smbus_read_byte() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
| 70 | This reads a single byte from a device, without specifying a device |
| 71 | register. Some devices are so simple that this interface is enough; for |
| 72 | others, it is a shorthand if you want to read the same register as in |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 73 | the previous SMBus command:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 75 | S Addr Rd [A] [Data] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 77 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE |
| 78 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 80 | SMBus Send Byte |
| 81 | =============== |
| 82 | |
| 83 | Implemented by i2c_smbus_write_byte() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 85 | This operation is the reverse of Receive Byte: it sends a single byte |
| 86 | to a device. See Receive Byte for more information. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 88 | :: |
| 89 | |
| 90 | S Addr Wr [A] Data [A] P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 92 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE |
| 93 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 95 | SMBus Read Byte |
| 96 | =============== |
| 97 | |
| 98 | Implemented by i2c_smbus_read_byte_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | |
| 100 | This reads a single byte from a device, from a designated register. |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 101 | The register is specified through the Comm byte:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 103 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 105 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA |
| 106 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 108 | SMBus Read Word |
| 109 | =============== |
| 110 | |
| 111 | Implemented by i2c_smbus_read_word_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 113 | This operation is very like Read Byte; again, data is read from a |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | device, from a designated register that is specified through the Comm |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 115 | byte. But this time, the data is a complete word (16 bits):: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 117 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 119 | Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA |
| 120 | |
Luca Ceresoli | b36cbb7 | 2020-01-29 16:19:41 +0100 | [diff] [blame] | 121 | Note the convenience function i2c_smbus_read_word_swapped() is |
Jonathan Cameron | 06a6784 | 2011-10-30 13:47:25 +0100 | [diff] [blame] | 122 | available for reads where the two data bytes are the other way |
| 123 | around (not SMBus compliant, but very popular.) |
| 124 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 126 | SMBus Write Byte |
| 127 | ================ |
| 128 | |
| 129 | Implemented by i2c_smbus_write_byte_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | |
| 131 | This writes a single byte to a device, to a designated register. The |
| 132 | register is specified through the Comm byte. This is the opposite of |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 133 | the Read Byte operation. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 135 | :: |
| 136 | |
| 137 | S Addr Wr [A] Comm [A] Data [A] P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 139 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
| 140 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 142 | SMBus Write Word |
| 143 | ================ |
| 144 | |
| 145 | Implemented by i2c_smbus_write_word_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 147 | This is the opposite of the Read Word operation. 16 bits |
Luca Ceresoli | 414a596 | 2020-01-29 16:19:42 +0100 | [diff] [blame] | 148 | of data are written to a device, to the designated register that is |
Luca Ceresoli | c7148b05 | 2020-01-29 16:19:43 +0100 | [diff] [blame] | 149 | specified through the Comm byte:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 151 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 153 | Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA |
| 154 | |
Luca Ceresoli | b36cbb7 | 2020-01-29 16:19:41 +0100 | [diff] [blame] | 155 | Note the convenience function i2c_smbus_write_word_swapped() is |
Jonathan Cameron | 06a6784 | 2011-10-30 13:47:25 +0100 | [diff] [blame] | 156 | available for writes where the two data bytes are the other way |
| 157 | around (not SMBus compliant, but very popular.) |
| 158 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 160 | SMBus Process Call |
| 161 | ================== |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | |
| 163 | This command selects a device register (through the Comm byte), sends |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 164 | 16 bits of data to it, and reads 16 bits of data in return:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 166 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] |
| 167 | S Addr Rd [A] [DataLow] A [DataHigh] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 169 | Functionality flag: I2C_FUNC_SMBUS_PROC_CALL |
| 170 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 172 | SMBus Block Read |
| 173 | ================ |
| 174 | |
| 175 | Implemented by i2c_smbus_read_block_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 177 | This command reads a block of up to 32 bytes from a device, from a |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | designated register that is specified through the Comm byte. The amount |
| 179 | of data is specified by the device in the Count byte. |
| 180 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 181 | :: |
| 182 | |
| 183 | S Addr Wr [A] Comm [A] |
| 184 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 186 | Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA |
| 187 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 189 | SMBus Block Write |
| 190 | ================= |
| 191 | |
| 192 | Implemented by i2c_smbus_write_block_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 194 | The opposite of the Block Read command, this writes up to 32 bytes to |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | a device, to a designated register that is specified through the |
| 196 | Comm byte. The amount of data is specified in the Count byte. |
| 197 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 198 | :: |
| 199 | |
| 200 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 202 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA |
| 203 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 205 | SMBus Block Write - Block Read Process Call |
| 206 | =========================================== |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 208 | SMBus Block Write - Block Read Process Call was introduced in |
| 209 | Revision 2.0 of the specification. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
| 211 | This command selects a device register (through the Comm byte), sends |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 212 | 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 214 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... |
| 215 | S Addr Rd [A] [Count] A [Data] ... A P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 217 | Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
| 218 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | |
| 220 | SMBus Host Notify |
| 221 | ================= |
| 222 | |
| 223 | This command is sent from a SMBus device acting as a master to the |
| 224 | SMBus host acting as a slave. |
| 225 | It is the same form as Write Word, with the command code replaced by the |
| 226 | alerting device's address. |
| 227 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 228 | :: |
| 229 | |
| 230 | [S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P] |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | |
Benjamin Tissoires | e456cd3 | 2016-06-09 16:53:48 +0200 | [diff] [blame] | 232 | This is implemented in the following way in the Linux kernel: |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 233 | |
Benjamin Tissoires | 4d5538f | 2016-10-13 14:10:40 +0200 | [diff] [blame] | 234 | * I2C bus drivers which support SMBus Host Notify should report |
| 235 | I2C_FUNC_SMBUS_HOST_NOTIFY. |
| 236 | * I2C bus drivers trigger SMBus Host Notify by a call to |
| 237 | i2c_handle_smbus_host_notify(). |
| 238 | * I2C drivers for devices which can trigger SMBus Host Notify will have |
| 239 | client->irq assigned to a Host Notify IRQ if noone else specified an other. |
| 240 | |
| 241 | There is currently no way to retrieve the data parameter from the client. |
Benjamin Tissoires | e456cd3 | 2016-06-09 16:53:48 +0200 | [diff] [blame] | 242 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
| 244 | Packet Error Checking (PEC) |
| 245 | =========================== |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 246 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | Packet Error Checking was introduced in Revision 1.1 of the specification. |
| 248 | |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 249 | PEC adds a CRC-8 error-checking byte to transfers using it, immediately |
| 250 | before the terminating STOP. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | |
| 252 | |
| 253 | Address Resolution Protocol (ARP) |
| 254 | ================================= |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 255 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | The Address Resolution Protocol was introduced in Revision 2.0 of |
| 257 | the specification. It is a higher-layer protocol which uses the |
| 258 | messages above. |
| 259 | |
| 260 | ARP adds device enumeration and dynamic address assignment to |
| 261 | the protocol. All ARP communications use slave address 0x61 and |
| 262 | require PEC checksums. |
| 263 | |
| 264 | |
Jean Delvare | b5527a7 | 2010-03-02 12:23:42 +0100 | [diff] [blame] | 265 | SMBus Alert |
| 266 | =========== |
| 267 | |
| 268 | SMBus Alert was introduced in Revision 1.0 of the specification. |
| 269 | |
| 270 | The SMBus alert protocol allows several SMBus slave devices to share a |
| 271 | single interrupt pin on the SMBus master, while still allowing the master |
| 272 | to know which slave triggered the interrupt. |
| 273 | |
| 274 | This is implemented the following way in the Linux kernel: |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 275 | |
Jean Delvare | b5527a7 | 2010-03-02 12:23:42 +0100 | [diff] [blame] | 276 | * I2C bus drivers which support SMBus alert should call |
Wolfram Sang | ed68052 | 2020-02-28 18:12:20 +0100 | [diff] [blame] | 277 | i2c_new_smbus_alert_device() to install SMBus alert support. |
Jean Delvare | b5527a7 | 2010-03-02 12:23:42 +0100 | [diff] [blame] | 278 | * I2C drivers for devices which can trigger SMBus alerts should implement |
| 279 | the optional alert() callback. |
| 280 | |
| 281 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | I2C Block Transactions |
| 283 | ====================== |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 284 | |
Luca Ceresoli | 95b8377 | 2020-01-29 16:19:44 +0100 | [diff] [blame] | 285 | The following I2C block transactions are similar to the SMBus Block Read |
| 286 | and Write operations, except these do not have a Count byte. They are |
| 287 | supported by the SMBus layer and are described here for completeness, but |
| 288 | they are *NOT* defined by the SMBus specification. |
David Brownell | 1a31a88 | 2008-05-11 20:37:05 +0200 | [diff] [blame] | 289 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | I2C block transactions do not limit the number of bytes transferred |
| 291 | but the SMBus layer places a limit of 32 bytes. |
| 292 | |
| 293 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 294 | I2C Block Read |
| 295 | ============== |
| 296 | |
| 297 | Implemented by i2c_smbus_read_i2c_block_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 299 | This command reads a block of bytes from a device, from a |
| 300 | designated register that is specified through the Comm byte:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 302 | S Addr Wr [A] Comm [A] |
| 303 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 305 | Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | |
| 307 | |
Luca Ceresoli | 3c13f1f | 2020-01-29 16:19:40 +0100 | [diff] [blame] | 308 | I2C Block Write |
| 309 | =============== |
| 310 | |
| 311 | Implemented by i2c_smbus_write_i2c_block_data() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 313 | The opposite of the Block Read command, this writes bytes to |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | a device, to a designated register that is specified through the |
| 315 | Comm byte. Note that command lengths of 0, 2, or more bytes are |
| 316 | supported as they are indistinguishable from data. |
| 317 | |
Mauro Carvalho Chehab | ccf988b | 2019-07-26 09:51:16 -0300 | [diff] [blame] | 318 | :: |
| 319 | |
| 320 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P |
Jean Delvare | a168178 | 2012-12-16 21:11:55 +0100 | [diff] [blame] | 321 | |
| 322 | Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK |