aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2014-04-06 07:37:38 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-04-06 07:53:48 -0400
commit9f02fba84be15aa5df1ae4710fb759658fe87b42 (patch)
treebfd7821edd503038e90bcf09ee04d63c3bb5a267
parentcf23e3358894181f0204d09fbfc5db167a4d28b5 (diff)
Documentation: i2c: improve section about flags mangling the protocol
Sort the entries alphabetically. Make the introductory paragraph more precise. Skip useless 'Flag' introduction from the entries. Remove trailing white spaces from the file. Add missing I2C_M_STOP entry. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--Documentation/i2c/i2c-protocol35
1 files changed, 20 insertions, 15 deletions
diff --git a/Documentation/i2c/i2c-protocol b/Documentation/i2c/i2c-protocol
index 0b3e62d1f77a..ff6d6cee6c7e 100644
--- a/Documentation/i2c/i2c-protocol
+++ b/Documentation/i2c/i2c-protocol
@@ -6,8 +6,8 @@ Key to symbols
6S (1 bit) : Start bit 6S (1 bit) : Start bit
7P (1 bit) : Stop bit 7P (1 bit) : Stop bit
8Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. 8Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0.
9A, NA (1 bit) : Accept and reverse accept bit. 9A, NA (1 bit) : Accept and reverse accept bit.
10Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to 10Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to
11 get a 10 bit I2C address. 11 get a 10 bit I2C address.
12Comm (8 bits): Command byte, a data byte which often selects a register on 12Comm (8 bits): Command byte, a data byte which often selects a register on
13 the device. 13 the device.
@@ -49,11 +49,20 @@ a byte read, followed by a byte write:
49Modified transactions 49Modified transactions
50===================== 50=====================
51 51
52The following modifications to the I2C protocol can also be generated, 52The following modifications to the I2C protocol can also be generated by
53with the exception of I2C_M_NOSTART these are usually only needed to 53setting these flags for i2c messages. With the exception of I2C_M_NOSTART, they
54work around device issues: 54are usually only needed to work around device issues:
55 55
56 Flag I2C_M_NOSTART: 56I2C_M_IGNORE_NAK:
57 Normally message is interrupted immediately if there is [NA] from the
58 client. Setting this flag treats any [NA] as [A], and all of
59 message is sent.
60 These messages may still fail to SCL lo->hi timeout.
61
62I2C_M_NO_RD_ACK:
63 In a read message, master A/NA bit is skipped.
64
65I2C_M_NOSTART:
57 In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some 66 In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some
58 point. For example, setting I2C_M_NOSTART on the second partial message 67 point. For example, setting I2C_M_NOSTART on the second partial message
59 generates something like: 68 generates something like:
@@ -67,17 +76,13 @@ work around device issues:
67 I2C device but may also be used between direction changes by some 76 I2C device but may also be used between direction changes by some
68 rare devices. 77 rare devices.
69 78
70 Flags I2C_M_REV_DIR_ADDR 79I2C_M_REV_DIR_ADDR:
71 This toggles the Rd/Wr flag. That is, if you want to do a write, but 80 This toggles the Rd/Wr flag. That is, if you want to do a write, but
72 need to emit an Rd instead of a Wr, or vice versa, you set this 81 need to emit an Rd instead of a Wr, or vice versa, you set this
73 flag. For example: 82 flag. For example:
74 S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P 83 S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P
75 84
76 Flags I2C_M_IGNORE_NAK 85I2C_M_STOP:
77 Normally message is interrupted immediately if there is [NA] from the 86 Force a stop condition (P) after the message. Some I2C related protocols
78 client. Setting this flag treats any [NA] as [A], and all of 87 like SCCB require that. Normally, you really don't want to get interrupted
79 message is sent. 88 between the messages of one transfer.
80 These messages may still fail to SCL lo->hi timeout.
81
82 Flags I2C_M_NO_RD_ACK
83 In a read message, master A/NA bit is skipped.