@@ -18,18 +18,18 @@
#include <linux/of_irq.h>
#include <linux/module.h>
-void of_i2c_register_devices(struct i2c_adapter *adap)
+void of_i2c_register_node_devices(struct i2c_adapter *adap,
+ struct device_node *parent_node)
{
void *result;
struct device_node *node;
- /* Only register child devices if the adapter has a node pointer set */
- if (!adap->dev.of_node)
+ if (!parent_node)
return;
dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
- for_each_child_of_node(adap->dev.of_node, node) {
+ for_each_child_of_node(parent_node, node) {
struct i2c_board_info info = {};
struct dev_archdata dev_ad = {};
const __be32 *addr;
@@ -76,6 +76,12 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
}
}
}
+EXPORT_SYMBOL(of_i2c_register_node_devices);
+
+void of_i2c_register_devices(struct i2c_adapter *adap)
+{
+ of_i2c_register_node_devices(adap, adap->dev.of_node);
+}
EXPORT_SYMBOL(of_i2c_register_devices);
static int of_dev_node_match(struct device *dev, void *data)
@@ -15,6 +15,9 @@
#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
#include <linux/i2c.h>
+extern void of_i2c_register_node_devices(struct i2c_adapter *adap,
+ struct device_node *parent_node);
+
extern void of_i2c_register_devices(struct i2c_adapter *adap);
/* must call put_device() when done with returned i2c_client device */
Probe devices for a node other that the adapter node. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> --- drivers/of/of_i2c.c | 14 ++++++++++---- include/linux/of_i2c.h | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-)