summaryrefslogtreecommitdiffstats
path: root/include/i2c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-11-03 21:53:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-15 08:34:53 +0100
commit47e176461fbbff0b6f3ad863ef7f1fd3bc2d3c02 (patch)
tree959d1fa7dce1f415a2cf9652b31f8b3b2e01d405 /include/i2c
parent106742b9009b0d04faabe52d21f9fd3cff408b32 (diff)
downloadbarebox-47e176461fbbff0b6f3ad863ef7f1fd3bc2d3c02.tar.gz
barebox-47e176461fbbff0b6f3ad863ef7f1fd3bc2d3c02.tar.xz
i2c: introduce i2c_new_dummy
This returns an I2C client bound to the "dummy" driver, intended for use with devices that consume multiple addresses. Examples of such chips include various EEPROMS (like 24c04 and 24c08 models). Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/i2c')
-rw-r--r--include/i2c/i2c.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index b05911909b..dc5e5fc99b 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -129,6 +129,14 @@ static inline int i2c_register_board_info(int busnum,
extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
struct i2c_adapter *i2c_get_adapter(int busnum);
+/* For devices that use several addresses, use i2c_new_dummy() to make
+ * client handles for the extra addresses.
+ */
+extern struct i2c_client *
+i2c_new_dummy(struct i2c_adapter *adap, u16 address);
+
+
+
extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
extern int i2c_master_send(struct i2c_client *client, const char *buf, int count);
extern int i2c_master_recv(struct i2c_client *client, char *buf, int count);