aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-08-11 12:20:56 -0400
committerJean Delvare <khali@linux-fr.org>2010-08-11 12:20:56 -0400
commit9a94241afcc9a481691a9c29b7460217925b59b8 (patch)
tree7f2d42935422a228686bcd8680dc97ff8a1005bc /include/linux/i2c.h
parentf1c2e33c295de423db5740647bfaa5e2ad139192 (diff)
i2c: Add support for custom probe function
The probe method used by i2c_new_probed_device() may not be suitable for all cases. Let the caller provide its own, optional probe function. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 38dd4025aa4e..59a9f3cdc0b5 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -284,12 +284,15 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
284 284
285/* If you don't know the exact address of an I2C device, use this variant 285/* If you don't know the exact address of an I2C device, use this variant
286 * instead, which can probe for device presence in a list of possible 286 * instead, which can probe for device presence in a list of possible
287 * addresses. 287 * addresses. The "probe" callback function is optional. If it is provided,
288 * it must return 1 on successful probe, 0 otherwise. If it is not provided,
289 * a default probing method is used.
288 */ 290 */
289extern struct i2c_client * 291extern struct i2c_client *
290i2c_new_probed_device(struct i2c_adapter *adap, 292i2c_new_probed_device(struct i2c_adapter *adap,
291 struct i2c_board_info *info, 293 struct i2c_board_info *info,
292 unsigned short const *addr_list); 294 unsigned short const *addr_list,
295 int (*probe)(struct i2c_adapter *, unsigned short addr));
293 296
294/* For devices that use several addresses, use i2c_new_dummy() to make 297/* For devices that use several addresses, use i2c_new_dummy() to make
295 * client handles for the extra addresses. 298 * client handles for the extra addresses.