sandbox: usb: Allow finding a USB emulator for a device
[platform/kernel/u-boot.git] / include / usb.h
index a09c7f1..d684531 100644 (file)
@@ -950,6 +950,16 @@ int usb_emul_bulk(struct udevice *emul, struct usb_device *udev,
 int usb_emul_find(struct udevice *bus, ulong pipe, struct udevice **emulp);
 
 /**
+ * usb_emul_find_for_dev() - Find an emulator for a particular device
+ *
+ * @bus:       USB bus (controller)
+ * @dev:       USB device to check
+ * @emulp:     Returns pointer to emulator, or NULL if not found
+ * @return 0 if found, -ve on error
+ */
+int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp);
+
+/**
  * usb_emul_reset() - Reset all emulators ready for use
  *
  * Clear out any address information in the emulators and make then ready for