aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-16 20:41:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-16 20:41:26 -0500
commit123df7ae0d0ed90d01ef4cb7316fa0b7ef0ec8a8 (patch)
tree85eea4f489152f0559abfcfeb94d100ef446278b /Documentation
parent9b690c3d56ce15dd265b6398f9d8d58c29c17032 (diff)
parenta1681781da691a95c2277d9dbd7f5962b6b9e368 (diff)
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull i2c update from Jean Delvare: "This is my last pull request for the i2c subsystem. It includes all the patches I collected between kernel v3.7-rc1 and me passing i2c maintenance duties over to Wolfram. Future patches to the many i2c bus drivers I still maintain will go through Wolfram's tree." * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: i2c: Mention functionality flags in SMBus protocol documentation i2c-piix4: Convert dev_printk(KERN_<LEVEL> to dev_<level>( i2c-i801: Enable interrupts for all post-ICH5 chips i2c-i801: Add device tree support MAINTAINERS: Fix drivers/i2c/busses/i2c-stub.c
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/i2c/smbus-protocol40
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
23single data byte, the functions using SMBus protocol operation names execute 23single data byte, the functions using SMBus protocol operation names execute
24a different protocol operation entirely. 24a different protocol operation entirely.
25 25
26Each transaction type corresponds to a functionality flag. Before calling a
27transaction function, a device driver should always check (just once) for
28the corresponding functionality flag to ensure that the underlying I2C
29adapter supports the transaction in question. See
30<file:Documentation/i2c/functionality> for the details.
31
26 32
27Key to symbols 33Key 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
50A Addr Rd/Wr [A] P 56A Addr Rd/Wr [A] P
51 57
58Functionality flag: I2C_FUNC_SMBUS_QUICK
59
52 60
53SMBus Receive Byte: i2c_smbus_read_byte() 61SMBus Receive Byte: i2c_smbus_read_byte()
54========================================== 62==========================================
@@ -60,6 +68,8 @@ the previous SMBus command.
60 68
61S Addr Rd [A] [Data] NA P 69S Addr Rd [A] [Data] NA P
62 70
71Functionality flag: I2C_FUNC_SMBUS_READ_BYTE
72
63 73
64SMBus Send Byte: i2c_smbus_write_byte() 74SMBus Send Byte: i2c_smbus_write_byte()
65======================================== 75========================================
@@ -69,6 +79,8 @@ to a device. See Receive Byte for more information.
69 79
70S Addr Wr [A] Data [A] P 80S Addr Wr [A] Data [A] P
71 81
82Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE
83
72 84
73SMBus Read Byte: i2c_smbus_read_byte_data() 85SMBus Read Byte: i2c_smbus_read_byte_data()
74============================================ 86============================================
@@ -78,6 +90,8 @@ The register is specified through the Comm byte.
78 90
79S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P 91S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P
80 92
93Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA
94
81 95
82SMBus Read Word: i2c_smbus_read_word_data() 96SMBus 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
89S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P 103S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P
90 104
105Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA
106
91Note the convenience function i2c_smbus_read_word_swapped is 107Note the convenience function i2c_smbus_read_word_swapped is
92available for reads where the two data bytes are the other way 108available for reads where the two data bytes are the other way
93around (not SMBus compliant, but very popular.) 109around (not SMBus compliant, but very popular.)
@@ -102,6 +118,8 @@ the Read Byte operation.
102 118
103S Addr Wr [A] Comm [A] Data [A] P 119S Addr Wr [A] Comm [A] Data [A] P
104 120
121Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA
122
105 123
106SMBus Write Word: i2c_smbus_write_word_data() 124SMBus Write Word: i2c_smbus_write_word_data()
107============================================== 125==============================================
@@ -112,6 +130,8 @@ specified through the Comm byte.
112 130
113S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P 131S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P
114 132
133Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA
134
115Note the convenience function i2c_smbus_write_word_swapped is 135Note the convenience function i2c_smbus_write_word_swapped is
116available for writes where the two data bytes are the other way 136available for writes where the two data bytes are the other way
117around (not SMBus compliant, but very popular.) 137around (not SMBus compliant, but very popular.)
@@ -126,6 +146,8 @@ This command selects a device register (through the Comm byte), sends
126S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] 146S 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
149Functionality flag: I2C_FUNC_SMBUS_PROC_CALL
150
129 151
130SMBus Block Read: i2c_smbus_read_block_data() 152SMBus Block Read: i2c_smbus_read_block_data()
131============================================== 153==============================================
@@ -137,6 +159,8 @@ of data is specified by the device in the Count byte.
137S Addr Wr [A] Comm [A] 159S 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
162Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA
163
140 164
141SMBus Block Write: i2c_smbus_write_block_data() 165SMBus 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
148S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P 172S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P
149 173
174Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
175
150 176
151SMBus Block Write - Block Read Process Call 177SMBus Block Write - Block Read Process Call
152=========================================== 178===========================================
@@ -160,6 +186,8 @@ This command selects a device register (through the Comm byte), sends
160S Addr Wr [A] Comm [A] Count [A] Data [A] ... 186S 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
189Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL
190
163 191
164SMBus Host Notify 192SMBus Host Notify
165================= 193=================
@@ -229,15 +257,7 @@ designated register that is specified through the Comm byte.
229S Addr Wr [A] Comm [A] 257S 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 260Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK
233I2C Block Read (2 Comm bytes)
234=============================
235
236This command reads a block of bytes from a device, from a
237designated register that is specified through the two Comm bytes.
238
239S Addr Wr [A] Comm1 [A] Comm2 [A]
240 S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
241 261
242 262
243I2C Block Write: i2c_smbus_write_i2c_block_data() 263I2C 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
249supported as they are indistinguishable from data. 269supported as they are indistinguishable from data.
250 270
251S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P 271S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P
272
273Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK