aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-05-01 17:26:31 -0400
committerJean Delvare <khali@hyperion.delvare>2007-05-01 17:26:31 -0400
commit12b5053ac58709c7d475888bc18d1f61958afc4e (patch)
tree13a6afc6ad6d3f22568045ba71277c1331fd4283 /include/linux/i2c.h
parent0f3b48385213355a2d4408bec1b481ffcf0e8638 (diff)
i2c: Add i2c_new_probed_device()
Add a new helper function to instantiate an i2c device. It is meant as a replacement for i2c_new_device() when you don't know for sure at which address your I2C/SMBus device lives. This happens frequently on TV adapters for example, you know there is a tuner chip on the bus, but depending on the exact board model and revision, it can live at different addresses. So, the new i2c_new_probed_device() function will probe the bus according to a list of addresses, and as soon as one of these addresses responds, it will call i2c_new_device() on that one address. This function will make it possible to port the old i2c drivers to the new model quickly. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 36d6814a6df4..da95ce79d075 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -245,6 +245,15 @@ struct i2c_board_info {
245extern struct i2c_client * 245extern struct i2c_client *
246i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info); 246i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
247 247
248/* If you don't know the exact address of an I2C device, use this variant
249 * instead, which can probe for device presence in a list of possible
250 * addresses.
251 */
252extern struct i2c_client *
253i2c_new_probed_device(struct i2c_adapter *adap,
254 struct i2c_board_info *info,
255 unsigned short const *addr_list);
256
248extern void i2c_unregister_device(struct i2c_client *); 257extern void i2c_unregister_device(struct i2c_client *);
249 258
250/* Mainboard arch_initcall() code should register all its I2C devices. 259/* Mainboard arch_initcall() code should register all its I2C devices.