mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
dm: Allow a device to be found by its FDT offset
Each device that was bound from a device tree has an node that caused it to be bound. Add functions that find and return a device based on a device tree offset. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -121,6 +121,22 @@ int uclass_get_device(enum uclass_id id, int index, struct udevice **devp);
|
||||
*/
|
||||
int uclass_get_device_by_seq(enum uclass_id id, int seq, struct udevice **devp);
|
||||
|
||||
/**
|
||||
* uclass_get_device_by_of_offset() - Get 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 probed to activate it ready for use.
|
||||
*
|
||||
* @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_get_device_by_of_offset(enum uclass_id id, int node,
|
||||
struct udevice **devp);
|
||||
|
||||
/**
|
||||
* uclass_first_device() - Get the first device in a uclass
|
||||
*
|
||||
|
Reference in New Issue
Block a user