summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:43:57 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:35 -0700
commit1b30d61d786421a5d02725a9945552cc9c09914b (patch)
tree7966d4351125613caf50d2f5417c5882818cda1f /include/dm
parent77eaa19e73f0c6b4c29982417676ab23cd72895a (diff)
downloadu-boot-imx-1b30d61d786421a5d02725a9945552cc9c09914b.zip
u-boot-imx-1b30d61d786421a5d02725a9945552cc9c09914b.tar.gz
u-boot-imx-1b30d61d786421a5d02725a9945552cc9c09914b.tar.bz2
dm: core: Export uclass_find_device_by_of_offset()
It is sometimes useful to be able to find a device before probing it, perhaps to set up some platform data for it. Allow finding by of_offset also. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/uclass-internal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h
index b51e1da..ad284b8 100644
--- a/include/dm/uclass-internal.h
+++ b/include/dm/uclass-internal.h
@@ -99,6 +99,22 @@ int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq,
bool find_req_seq, struct udevice **devp);
/**
+ * uclass_find_device_by_of_offset() - Find a uclass device by device tree node
+ *
+ * This searches the devices in the uclass for one attached to the given
+ * device tree node.
+ *
+ * The device is NOT probed, it is merely returned.
+ *
+ * @id: ID to look up
+ * @node: Device tree offset to search for (if -ve then -ENODEV is returned)
+ * @devp: Returns pointer to device (there is only one for each node)
+ * @return 0 if OK, -ve on error
+ */
+int uclass_find_device_by_of_offset(enum uclass_id id, int node,
+ struct udevice **devp);
+
+/**
* uclass_bind_device() - Associate device with a uclass
*
* Connect the device into uclass's list of devices.