Commit 9c2bdac40eba639c438690b1245a020e7c2530df
Exists in
master
and in
39 other branches
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Prevent log spam on some DVB adapters i2c: Add missing kerneldoc descriptions i2c: Fix device_init_wakeup place
Showing 2 changed files Side-by-side Diff
drivers/i2c/i2c-core.c
... | ... | @@ -108,6 +108,9 @@ |
108 | 108 | if (!driver->probe || !driver->id_table) |
109 | 109 | return -ENODEV; |
110 | 110 | client->driver = driver; |
111 | + if (!device_can_wakeup(&client->dev)) | |
112 | + device_init_wakeup(&client->dev, | |
113 | + client->flags & I2C_CLIENT_WAKE); | |
111 | 114 | dev_dbg(dev, "probe\n"); |
112 | 115 | |
113 | 116 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); |
114 | 117 | |
... | ... | @@ -262,9 +265,8 @@ |
262 | 265 | client->adapter = adap; |
263 | 266 | |
264 | 267 | client->dev.platform_data = info->platform_data; |
265 | - device_init_wakeup(&client->dev, info->flags & I2C_CLIENT_WAKE); | |
266 | 268 | |
267 | - client->flags = info->flags & ~I2C_CLIENT_WAKE; | |
269 | + client->flags = info->flags; | |
268 | 270 | client->addr = info->addr; |
269 | 271 | client->irq = info->irq; |
270 | 272 | |
... | ... | @@ -1188,8 +1190,8 @@ |
1188 | 1190 | && address_data->normal_i2c[0] == I2C_CLIENT_END) |
1189 | 1191 | return 0; |
1190 | 1192 | |
1191 | - dev_warn(&adapter->dev, "SMBus Quick command not supported, " | |
1192 | - "can't probe for chips\n"); | |
1193 | + dev_dbg(&adapter->dev, "SMBus Quick command not supported, " | |
1194 | + "can't probe for chips\n"); | |
1193 | 1195 | return -EOPNOTSUPP; |
1194 | 1196 | } |
1195 | 1197 | |
... | ... | @@ -1350,6 +1352,10 @@ |
1350 | 1352 | } |
1351 | 1353 | } |
1352 | 1354 | |
1355 | + /* Stop here if the classes do not match */ | |
1356 | + if (!(adapter->class & driver->class)) | |
1357 | + goto exit_free; | |
1358 | + | |
1353 | 1359 | /* Stop here if we can't use SMBUS_QUICK */ |
1354 | 1360 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { |
1355 | 1361 | if (address_data->probe[0] == I2C_CLIENT_END |
... | ... | @@ -1361,10 +1367,6 @@ |
1361 | 1367 | err = -EOPNOTSUPP; |
1362 | 1368 | goto exit_free; |
1363 | 1369 | } |
1364 | - | |
1365 | - /* Stop here if the classes do not match */ | |
1366 | - if (!(adapter->class & driver->class)) | |
1367 | - goto exit_free; | |
1368 | 1370 | |
1369 | 1371 | /* Probe entries are done second, and are not affected by ignore |
1370 | 1372 | entries either */ |
include/linux/i2c.h
... | ... | @@ -97,7 +97,19 @@ |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * struct i2c_driver - represent an I2C device driver |
100 | + * @id: Unique driver ID (optional) | |
100 | 101 | * @class: What kind of i2c device we instantiate (for detect) |
102 | + * @attach_adapter: Callback for bus addition (for legacy drivers) | |
103 | + * @detach_adapter: Callback for bus removal (for legacy drivers) | |
104 | + * @detach_client: Callback for device removal (for legacy drivers) | |
105 | + * @probe: Callback for device binding (new-style drivers) | |
106 | + * @remove: Callback for device unbinding (new-style drivers) | |
107 | + * @shutdown: Callback for device shutdown | |
108 | + * @suspend: Callback for device suspend | |
109 | + * @resume: Callback for device resume | |
110 | + * @command: Callback for bus-wide signaling (optional) | |
111 | + * @driver: Device driver model driver | |
112 | + * @id_table: List of I2C devices supported by this driver | |
101 | 113 | * @detect: Callback for device detection |
102 | 114 | * @address_data: The I2C addresses to probe, ignore or force (for detect) |
103 | 115 | * @clients: List of detected clients we created (for i2c-core use only) |