summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-08-11 18:20:56 +0200
committerJean Delvare <khali@linux-fr.org>2010-08-11 18:20:56 +0200
commit9a94241afcc9a481691a9c29b7460217925b59b8 (patch)
tree7f2d42935422a228686bcd8680dc97ff8a1005bc /include
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')
-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);
/* If you don't know the exact address of an I2C device, use this variant
* instead, which can probe for device presence in a list of possible
- * addresses.
+ * addresses. The "probe" callback function is optional. If it is provided,
+ * it must return 1 on successful probe, 0 otherwise. If it is not provided,
+ * a default probing method is used.
*/
extern struct i2c_client *
i2c_new_probed_device(struct i2c_adapter *adap,
struct i2c_board_info *info,
- unsigned short const *addr_list);
+ unsigned short const *addr_list,
+ int (*probe)(struct i2c_adapter *, unsigned short addr));
/* For devices that use several addresses, use i2c_new_dummy() to make
* client handles for the extra addresses.