X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fdm%2Fuclass-internal.h;h=8a4839ee882830484195974e96a3924cb4d11c8b;hb=0a3d59e01038a3a50484b8bfcf834376a7215af0;hp=7ba064bd53f62a470923143a36eff221c15c27e1;hpb=e8f80a5a58c9b506453cc0780687e8ed457d30a6;p=oweals%2Fu-boot.git diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index 7ba064bd53..8a4839ee88 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -23,6 +23,17 @@ */ int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp); +/** + * dev_get_uclass_index() - Get uclass and index of device + * @dev: - in - Device that we want the uclass/index of + * @ucp: - out - A pointer to the uclass the device belongs to + * + * The device is not prepared for use - this is an internal function. + * + * @return the index of the device in the uclass list or -ENODEV if not found. + */ +int dev_get_uclass_index(struct udevice *dev, struct uclass **ucp); + /** * uclass_find_device() - Return n-th child of uclass * @id: Id number of the uclass @@ -131,6 +142,23 @@ int uclass_find_device_by_of_offset(enum uclass_id id, int node, int uclass_find_device_by_ofnode(enum uclass_id id, ofnode node, struct udevice **devp); +/** + * uclass_find_device_by_phandle() - Find a uclass device by phandle + * + * This searches the devices in the uclass for one with the given phandle. + * + * The device is NOT probed, it is merely returned. + * + * @id: ID to look up + * @parent: Parent device containing the phandle pointer + * @name: Name of property in the parent device node + * @devp: Returns pointer to device (there is only one for each node) + * @return 0 if OK, -ENOENT if there is no @name present in the node, other + * -ve on error + */ +int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent, + const char *name, struct udevice **devp); + /** * uclass_bind_device() - Associate device with a uclass *