summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-11-11 16:56:18 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-19 08:58:25 +0100
commit901b13e243d0d608bd5f29acd3e373bedc83a195 (patch)
tree07df04dffc6cce2cbc7daac9716e2f6672615712 /include
parent9e6f482cd8400633a50e8249d71152a4277a75a7 (diff)
downloadbarebox-901b13e243d0d608bd5f29acd3e373bedc83a195.tar.gz
barebox-901b13e243d0d608bd5f29acd3e373bedc83a195.tar.xz
i2c: Create for_each_i2c_adapter()
This can be used by the i2c_probe command to iterate over i2c adapters. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/i2c/i2c.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index 12e4827755..3fab76d9f6 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -235,6 +235,10 @@ extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
struct i2c_adapter *i2c_get_adapter(int busnum);
struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
+extern struct list_head i2c_adapter_list;
+#define for_each_i2c_adapter(adap) \
+ list_for_each_entry(adap, &i2c_adapter_list, list)
+
/* For devices that use several addresses, use i2c_new_dummy() to make
* client handles for the extra addresses.
*/