summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dm/device.h14
-rw-r--r--include/dt-structs.h6
2 files changed, 17 insertions, 3 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 993c9e6c5ab..5bef4842470 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -554,6 +554,20 @@ int device_get_by_driver_info(const struct driver_info *info,
struct udevice **devp);
/**
+ * device_get_by_driver_info_idx() - Get a device based on driver_info index
+ *
+ * Locates a device by its struct driver_info, by using its index number which
+ * is written into the idx field of struct phandle_1_arg, etc.
+ *
+ * The device is probed to activate it ready for use.
+ *
+ * @idx: Index number of the driver_info structure (0=first)
+ * @devp: Returns pointer to device if found, otherwise this is set to NULL
+ * @return 0 if OK, -ve on error
+ */
+int device_get_by_driver_info_idx(uint idx, struct udevice **devp);
+
+/**
* device_find_first_child() - Find the first child of a device
*
* @parent: Parent device to search
diff --git a/include/dt-structs.h b/include/dt-structs.h
index eed8273d18e..f0e1c9cb901 100644
--- a/include/dt-structs.h
+++ b/include/dt-structs.h
@@ -11,17 +11,17 @@
struct driver_info;
struct phandle_0_arg {
- const struct driver_info *node;
+ uint idx;
int arg[0];
};
struct phandle_1_arg {
- const struct driver_info *node;
+ uint idx;
int arg[1];
};
struct phandle_2_arg {
- const struct driver_info *node;
+ uint idx;
int arg[2];
};
#include <generated/dt-structs-gen.h>