diff options
| -rw-r--r-- | Documentation/i2c/smbus-protocol | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol index 49f5b680809d..d1f22618e14b 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol | |||
| @@ -23,6 +23,12 @@ don't match these function names. For some of the operations which pass a | |||
| 23 | single data byte, the functions using SMBus protocol operation names execute | 23 | single data byte, the functions using SMBus protocol operation names execute |
| 24 | a different protocol operation entirely. | 24 | a different protocol operation entirely. |
| 25 | 25 | ||
| 26 | Each transaction type corresponds to a functionality flag. Before calling a | ||
| 27 | transaction function, a device driver should always check (just once) for | ||
| 28 | the corresponding functionality flag to ensure that the underlying I2C | ||
| 29 | adapter supports the transaction in question. See | ||
| 30 | <file:Documentation/i2c/functionality> for the details. | ||
| 31 | |||
| 26 | 32 | ||
| 27 | Key to symbols | 33 | Key to symbols |
| 28 | ============== | 34 | ============== |
| @@ -49,6 +55,8 @@ This sends a single bit to the device, at the place of the Rd/Wr bit. | |||
| 49 | 55 | ||
| 50 | A Addr Rd/Wr [A] P | 56 | A Addr Rd/Wr [A] P |
| 51 | 57 | ||
| 58 | Functionality flag: I2C_FUNC_SMBUS_QUICK | ||
| 59 | |||
| 52 | 60 | ||
| 53 | SMBus Receive Byte: i2c_smbus_read_byte() | 61 | SMBus Receive Byte: i2c_smbus_read_byte() |
| 54 | ========================================== | 62 | ========================================== |
| @@ -60,6 +68,8 @@ the previous SMBus command. | |||
| 60 | 68 | ||
| 61 | S Addr Rd [A] [Data] NA P | 69 | S Addr Rd [A] [Data] NA P |
| 62 | 70 | ||
| 71 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE | ||
| 72 | |||
| 63 | 73 | ||
| 64 | SMBus Send Byte: i2c_smbus_write_byte() | 74 | SMBus Send Byte: i2c_smbus_write_byte() |
| 65 | ======================================== | 75 | ======================================== |
| @@ -69,6 +79,8 @@ to a device. See Receive Byte for more information. | |||
| 69 | 79 | ||
| 70 | S Addr Wr [A] Data [A] P | 80 | S Addr Wr [A] Data [A] P |
| 71 | 81 | ||
| 82 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE | ||
| 83 | |||
| 72 | 84 | ||
| 73 | SMBus Read Byte: i2c_smbus_read_byte_data() | 85 | SMBus Read Byte: i2c_smbus_read_byte_data() |
| 74 | ============================================ | 86 | ============================================ |
| @@ -78,6 +90,8 @@ The register is specified through the Comm byte. | |||
| 78 | 90 | ||
| 79 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P | 91 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P |
| 80 | 92 | ||
| 93 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA | ||
| 94 | |||
| 81 | 95 | ||
| 82 | SMBus Read Word: i2c_smbus_read_word_data() | 96 | SMBus Read Word: i2c_smbus_read_word_data() |
| 83 | ============================================ | 97 | ============================================ |
| @@ -88,6 +102,8 @@ byte. But this time, the data is a complete word (16 bits). | |||
| 88 | 102 | ||
| 89 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P | 103 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P |
| 90 | 104 | ||
| 105 | Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA | ||
| 106 | |||
| 91 | Note the convenience function i2c_smbus_read_word_swapped is | 107 | Note the convenience function i2c_smbus_read_word_swapped is |
| 92 | available for reads where the two data bytes are the other way | 108 | available for reads where the two data bytes are the other way |
| 93 | around (not SMBus compliant, but very popular.) | 109 | around (not SMBus compliant, but very popular.) |
| @@ -102,6 +118,8 @@ the Read Byte operation. | |||
| 102 | 118 | ||
| 103 | S Addr Wr [A] Comm [A] Data [A] P | 119 | S Addr Wr [A] Comm [A] Data [A] P |
| 104 | 120 | ||
| 121 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA | ||
| 122 | |||
| 105 | 123 | ||
| 106 | SMBus Write Word: i2c_smbus_write_word_data() | 124 | SMBus Write Word: i2c_smbus_write_word_data() |
| 107 | ============================================== | 125 | ============================================== |
| @@ -112,6 +130,8 @@ specified through the Comm byte. | |||
| 112 | 130 | ||
| 113 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P | 131 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
| 114 | 132 | ||
| 133 | Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA | ||
| 134 | |||
| 115 | Note the convenience function i2c_smbus_write_word_swapped is | 135 | Note the convenience function i2c_smbus_write_word_swapped is |
| 116 | available for writes where the two data bytes are the other way | 136 | available for writes where the two data bytes are the other way |
| 117 | around (not SMBus compliant, but very popular.) | 137 | around (not SMBus compliant, but very popular.) |
| @@ -126,6 +146,8 @@ This command selects a device register (through the Comm byte), sends | |||
| 126 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] | 146 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] |
| 127 | S Addr Rd [A] [DataLow] A [DataHigh] NA P | 147 | S Addr Rd [A] [DataLow] A [DataHigh] NA P |
| 128 | 148 | ||
| 149 | Functionality flag: I2C_FUNC_SMBUS_PROC_CALL | ||
| 150 | |||
| 129 | 151 | ||
| 130 | SMBus Block Read: i2c_smbus_read_block_data() | 152 | SMBus Block Read: i2c_smbus_read_block_data() |
| 131 | ============================================== | 153 | ============================================== |
| @@ -137,6 +159,8 @@ of data is specified by the device in the Count byte. | |||
| 137 | S Addr Wr [A] Comm [A] | 159 | S Addr Wr [A] Comm [A] |
| 138 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P | 160 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P |
| 139 | 161 | ||
| 162 | Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA | ||
| 163 | |||
| 140 | 164 | ||
| 141 | SMBus Block Write: i2c_smbus_write_block_data() | 165 | SMBus Block Write: i2c_smbus_write_block_data() |
| 142 | ================================================ | 166 | ================================================ |
| @@ -147,6 +171,8 @@ Comm byte. The amount of data is specified in the Count byte. | |||
| 147 | 171 | ||
| 148 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P | 172 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P |
| 149 | 173 | ||
| 174 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | ||
| 175 | |||
| 150 | 176 | ||
| 151 | SMBus Block Write - Block Read Process Call | 177 | SMBus Block Write - Block Read Process Call |
| 152 | =========================================== | 178 | =========================================== |
| @@ -160,6 +186,8 @@ This command selects a device register (through the Comm byte), sends | |||
| 160 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... | 186 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... |
| 161 | S Addr Rd [A] [Count] A [Data] ... A P | 187 | S Addr Rd [A] [Count] A [Data] ... A P |
| 162 | 188 | ||
| 189 | Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL | ||
| 190 | |||
| 163 | 191 | ||
| 164 | SMBus Host Notify | 192 | SMBus Host Notify |
| 165 | ================= | 193 | ================= |
| @@ -229,15 +257,7 @@ designated register that is specified through the Comm byte. | |||
| 229 | S Addr Wr [A] Comm [A] | 257 | S Addr Wr [A] Comm [A] |
| 230 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | 258 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P |
| 231 | 259 | ||
| 232 | 260 | Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK | |
| 233 | I2C Block Read (2 Comm bytes) | ||
| 234 | ============================= | ||
| 235 | |||
| 236 | This command reads a block of bytes from a device, from a | ||
| 237 | designated register that is specified through the two Comm bytes. | ||
| 238 | |||
| 239 | S Addr Wr [A] Comm1 [A] Comm2 [A] | ||
| 240 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | ||
| 241 | 261 | ||
| 242 | 262 | ||
| 243 | I2C Block Write: i2c_smbus_write_i2c_block_data() | 263 | I2C Block Write: i2c_smbus_write_i2c_block_data() |
| @@ -249,3 +269,5 @@ Comm byte. Note that command lengths of 0, 2, or more bytes are | |||
| 249 | supported as they are indistinguishable from data. | 269 | supported as they are indistinguishable from data. |
| 250 | 270 | ||
| 251 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P | 271 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P |
| 272 | |||
| 273 | Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK | ||
