diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 20:41:26 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 20:41:26 -0500 |
| commit | 123df7ae0d0ed90d01ef4cb7316fa0b7ef0ec8a8 (patch) | |
| tree | 85eea4f489152f0559abfcfeb94d100ef446278b | |
| parent | 9b690c3d56ce15dd265b6398f9d8d58c29c17032 (diff) | |
| parent | a1681781da691a95c2277d9dbd7f5962b6b9e368 (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
| -rw-r--r-- | Documentation/i2c/smbus-protocol | 40 | ||||
| -rw-r--r-- | MAINTAINERS | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 13 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-piix4.c | 5 |
4 files changed, 37 insertions, 23 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 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index f71d2f901a69..d9c31b906ac9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3712,7 +3712,7 @@ I2C/SMBUS STUB DRIVER | |||
| 3712 | M: "Mark M. Hoffman" <mhoffman@lightlink.com> | 3712 | M: "Mark M. Hoffman" <mhoffman@lightlink.com> |
| 3713 | L: linux-i2c@vger.kernel.org | 3713 | L: linux-i2c@vger.kernel.org |
| 3714 | S: Maintained | 3714 | S: Maintained |
| 3715 | F: drivers/i2c/busses/i2c-stub.c | 3715 | F: drivers/i2c/i2c-stub.c |
| 3716 | 3716 | ||
| 3717 | I2C SUBSYSTEM | 3717 | I2C SUBSYSTEM |
| 3718 | M: Wolfram Sang <w.sang@pengutronix.de> | 3718 | M: Wolfram Sang <w.sang@pengutronix.de> |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 6abc00d59881..1e73638225e1 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
| @@ -81,6 +81,7 @@ | |||
| 81 | #include <linux/slab.h> | 81 | #include <linux/slab.h> |
| 82 | #include <linux/wait.h> | 82 | #include <linux/wait.h> |
| 83 | #include <linux/err.h> | 83 | #include <linux/err.h> |
| 84 | #include <linux/of_i2c.h> | ||
| 84 | 85 | ||
| 85 | #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ | 86 | #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ |
| 86 | defined CONFIG_DMI | 87 | defined CONFIG_DMI |
| @@ -1108,6 +1109,7 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
| 1108 | /* fall through */ | 1109 | /* fall through */ |
| 1109 | default: | 1110 | default: |
| 1110 | priv->features |= FEATURE_I2C_BLOCK_READ; | 1111 | priv->features |= FEATURE_I2C_BLOCK_READ; |
| 1112 | priv->features |= FEATURE_IRQ; | ||
| 1111 | /* fall through */ | 1113 | /* fall through */ |
| 1112 | case PCI_DEVICE_ID_INTEL_82801DB_3: | 1114 | case PCI_DEVICE_ID_INTEL_82801DB_3: |
| 1113 | priv->features |= FEATURE_SMBUS_PEC; | 1115 | priv->features |= FEATURE_SMBUS_PEC; |
| @@ -1120,16 +1122,6 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
| 1120 | break; | 1122 | break; |
| 1121 | } | 1123 | } |
| 1122 | 1124 | ||
| 1123 | /* IRQ processing tested on CougarPoint PCH, ICH5, ICH7-M and ICH10 */ | ||
| 1124 | if (dev->device == PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS || | ||
| 1125 | dev->device == PCI_DEVICE_ID_INTEL_82801EB_3 || | ||
| 1126 | dev->device == PCI_DEVICE_ID_INTEL_ICH7_17 || | ||
| 1127 | dev->device == PCI_DEVICE_ID_INTEL_ICH8_5 || | ||
| 1128 | dev->device == PCI_DEVICE_ID_INTEL_ICH9_6 || | ||
| 1129 | dev->device == PCI_DEVICE_ID_INTEL_ICH10_4 || | ||
| 1130 | dev->device == PCI_DEVICE_ID_INTEL_ICH10_5) | ||
| 1131 | priv->features |= FEATURE_IRQ; | ||
| 1132 | |||
| 1133 | /* Disable features on user request */ | 1125 | /* Disable features on user request */ |
| 1134 | for (i = 0; i < ARRAY_SIZE(i801_feature_names); i++) { | 1126 | for (i = 0; i < ARRAY_SIZE(i801_feature_names); i++) { |
| 1135 | if (priv->features & disable_features & (1 << i)) | 1127 | if (priv->features & disable_features & (1 << i)) |
| @@ -1215,6 +1207,7 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
| 1215 | goto exit_free_irq; | 1207 | goto exit_free_irq; |
| 1216 | } | 1208 | } |
| 1217 | 1209 | ||
| 1210 | of_i2c_register_devices(&priv->adapter); | ||
| 1218 | i801_probe_optional_slaves(priv); | 1211 | i801_probe_optional_slaves(priv); |
| 1219 | /* We ignore errors - multiplexing is optional */ | 1212 | /* We ignore errors - multiplexing is optional */ |
| 1220 | i801_add_mux(priv); | 1213 | i801_add_mux(priv); |
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 8bbd6ece7c41..f7216ed2f3a9 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
| @@ -204,9 +204,8 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev, | |||
| 204 | */ | 204 | */ |
| 205 | pci_write_config_byte(PIIX4_dev, SMBHSTCFG, | 205 | pci_write_config_byte(PIIX4_dev, SMBHSTCFG, |
| 206 | temp | 1); | 206 | temp | 1); |
| 207 | dev_printk(KERN_NOTICE, &PIIX4_dev->dev, | 207 | dev_notice(&PIIX4_dev->dev, |
| 208 | "WARNING: SMBus interface has been " | 208 | "WARNING: SMBus interface has been FORCEFULLY ENABLED!\n"); |
| 209 | "FORCEFULLY ENABLED!\n"); | ||
| 210 | } else { | 209 | } else { |
| 211 | dev_err(&PIIX4_dev->dev, | 210 | dev_err(&PIIX4_dev->dev, |
| 212 | "Host SMBus controller not enabled!\n"); | 211 | "Host SMBus controller not enabled!\n"); |
