diff options
| -rw-r--r-- | Documentation/i2c/i2c-protocol | 35 |
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 | |||
| 6 | S (1 bit) : Start bit | 6 | S (1 bit) : Start bit |
| 7 | P (1 bit) : Stop bit | 7 | P (1 bit) : Stop bit |
| 8 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. | 8 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. |
| 9 | A, NA (1 bit) : Accept and reverse accept bit. | 9 | A, NA (1 bit) : Accept and reverse accept bit. |
| 10 | Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to | 10 | Addr (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. |
| 12 | Comm (8 bits): Command byte, a data byte which often selects a register on | 12 | Comm (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: | |||
| 49 | Modified transactions | 49 | Modified transactions |
| 50 | ===================== | 50 | ===================== |
| 51 | 51 | ||
| 52 | The following modifications to the I2C protocol can also be generated, | 52 | The following modifications to the I2C protocol can also be generated by |
| 53 | with the exception of I2C_M_NOSTART these are usually only needed to | 53 | setting these flags for i2c messages. With the exception of I2C_M_NOSTART, they |
| 54 | work around device issues: | 54 | are usually only needed to work around device issues: |
| 55 | 55 | ||
| 56 | Flag I2C_M_NOSTART: | 56 | I2C_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 | |||
| 62 | I2C_M_NO_RD_ACK: | ||
| 63 | In a read message, master A/NA bit is skipped. | ||
| 64 | |||
| 65 | I2C_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 | 79 | I2C_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 | 85 | I2C_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. | ||
