Commit 123df7ae0d0ed90d01ef4cb7316fa0b7ef0ec8a8

Authored by Linus Torvalds

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

Showing 4 changed files Side-by-side Diff

Documentation/i2c/smbus-protocol
... ... @@ -23,7 +23,13 @@
23 23 single data byte, the functions using SMBus protocol operation names execute
24 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.
26 31  
  32 +
27 33 Key to symbols
28 34 ==============
29 35  
30 36  
... ... @@ -49,7 +55,9 @@
49 55  
50 56 A Addr Rd/Wr [A] P
51 57  
  58 +Functionality flag: I2C_FUNC_SMBUS_QUICK
52 59  
  60 +
53 61 SMBus Receive Byte: i2c_smbus_read_byte()
54 62 ==========================================
55 63  
56 64  
... ... @@ -60,7 +68,9 @@
60 68  
61 69 S Addr Rd [A] [Data] NA P
62 70  
  71 +Functionality flag: I2C_FUNC_SMBUS_READ_BYTE
63 72  
  73 +
64 74 SMBus Send Byte: i2c_smbus_write_byte()
65 75 ========================================
66 76  
67 77  
... ... @@ -69,7 +79,9 @@
69 79  
70 80 S Addr Wr [A] Data [A] P
71 81  
  82 +Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE
72 83  
  84 +
73 85 SMBus Read Byte: i2c_smbus_read_byte_data()
74 86 ============================================
75 87  
76 88  
... ... @@ -78,7 +90,9 @@
78 90  
79 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
81 94  
  95 +
82 96 SMBus Read Word: i2c_smbus_read_word_data()
83 97 ============================================
84 98  
... ... @@ -88,6 +102,8 @@
88 102  
89 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 107 Note the convenience function i2c_smbus_read_word_swapped is
92 108 available for reads where the two data bytes are the other way
93 109 around (not SMBus compliant, but very popular.)
94 110  
... ... @@ -102,7 +118,9 @@
102 118  
103 119 S Addr Wr [A] Comm [A] Data [A] P
104 120  
  121 +Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA
105 122  
  123 +
106 124 SMBus Write Word: i2c_smbus_write_word_data()
107 125 ==============================================
108 126  
... ... @@ -112,6 +130,8 @@
112 130  
113 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 135 Note the convenience function i2c_smbus_write_word_swapped is
116 136 available for writes where the two data bytes are the other way
117 137 around (not SMBus compliant, but very popular.)
118 138  
... ... @@ -126,7 +146,9 @@
126 146 S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A]
127 147 S Addr Rd [A] [DataLow] A [DataHigh] NA P
128 148  
  149 +Functionality flag: I2C_FUNC_SMBUS_PROC_CALL
129 150  
  151 +
130 152 SMBus Block Read: i2c_smbus_read_block_data()
131 153 ==============================================
132 154  
133 155  
... ... @@ -137,7 +159,9 @@
137 159 S Addr Wr [A] Comm [A]
138 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
140 163  
  164 +
141 165 SMBus Block Write: i2c_smbus_write_block_data()
142 166 ================================================
143 167  
144 168  
... ... @@ -147,7 +171,9 @@
147 171  
148 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
150 175  
  176 +
151 177 SMBus Block Write - Block Read Process Call
152 178 ===========================================
153 179  
154 180  
... ... @@ -160,7 +186,9 @@
160 186 S Addr Wr [A] Comm [A] Count [A] Data [A] ...
161 187 S Addr Rd [A] [Count] A [Data] ... A P
162 188  
  189 +Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL
163 190  
  191 +
164 192 SMBus Host Notify
165 193 =================
166 194  
167 195  
168 196  
... ... @@ -229,17 +257,9 @@
229 257 S Addr Wr [A] Comm [A]
230 258 S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
231 259  
  260 +Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK
232 261  
233   -I2C Block Read (2 Comm bytes)
234   -=============================
235 262  
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   -
242   -
243 263 I2C Block Write: i2c_smbus_write_i2c_block_data()
244 264 ==================================================
245 265  
... ... @@ -249,4 +269,6 @@
249 269 supported as they are indistinguishable from data.
250 270  
251 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
... ... @@ -3712,7 +3712,7 @@
3712 3712 M: "Mark M. Hoffman" <mhoffman@lightlink.com>
3713 3713 L: linux-i2c@vger.kernel.org
3714 3714 S: Maintained
3715   -F: drivers/i2c/busses/i2c-stub.c
  3715 +F: drivers/i2c/i2c-stub.c
3716 3716  
3717 3717 I2C SUBSYSTEM
3718 3718 M: Wolfram Sang <w.sang@pengutronix.de>
drivers/i2c/busses/i2c-i801.c
... ... @@ -81,6 +81,7 @@
81 81 #include <linux/slab.h>
82 82 #include <linux/wait.h>
83 83 #include <linux/err.h>
  84 +#include <linux/of_i2c.h>
84 85  
85 86 #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
86 87 defined CONFIG_DMI
... ... @@ -1108,6 +1109,7 @@
1108 1109 /* fall through */
1109 1110 default:
1110 1111 priv->features |= FEATURE_I2C_BLOCK_READ;
  1112 + priv->features |= FEATURE_IRQ;
1111 1113 /* fall through */
1112 1114 case PCI_DEVICE_ID_INTEL_82801DB_3:
1113 1115 priv->features |= FEATURE_SMBUS_PEC;
... ... @@ -1120,16 +1122,6 @@
1120 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 1125 /* Disable features on user request */
1134 1126 for (i = 0; i < ARRAY_SIZE(i801_feature_names); i++) {
1135 1127 if (priv->features & disable_features & (1 << i))
... ... @@ -1215,6 +1207,7 @@
1215 1207 goto exit_free_irq;
1216 1208 }
1217 1209  
  1210 + of_i2c_register_devices(&priv->adapter);
1218 1211 i801_probe_optional_slaves(priv);
1219 1212 /* We ignore errors - multiplexing is optional */
1220 1213 i801_add_mux(priv);
drivers/i2c/busses/i2c-piix4.c
... ... @@ -204,9 +204,8 @@
204 204 */
205 205 pci_write_config_byte(PIIX4_dev, SMBHSTCFG,
206 206 temp | 1);
207   - dev_printk(KERN_NOTICE, &PIIX4_dev->dev,
208   - "WARNING: SMBus interface has been "
209   - "FORCEFULLY ENABLED!\n");
  207 + dev_notice(&PIIX4_dev->dev,
  208 + "WARNING: SMBus interface has been FORCEFULLY ENABLED!\n");
210 209 } else {
211 210 dev_err(&PIIX4_dev->dev,
212 211 "Host SMBus controller not enabled!\n");