summaryrefslogtreecommitdiffstats
path: root/include/usb.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-08 23:47:55 -0700
committerSimon Glass <sjg@chromium.org>2015-11-19 20:27:51 -0700
commitaf9c7c11e97ce99a8b8a0de99f91bde1b703377e (patch)
tree174b9e5b545fac3c1d50c8dbc91b187a0a3fcd4b /include/usb.h
parent80438a6c71b95b2749bdf5c58f7ff26f2907f3d5 (diff)
downloadblackbird-obmc-uboot-af9c7c11e97ce99a8b8a0de99f91bde1b703377e.tar.gz
blackbird-obmc-uboot-af9c7c11e97ce99a8b8a0de99f91bde1b703377e.zip
sandbox: usb: Allow finding a USB emulator for a device
Each USB device has an emulator. Currently this can only be found by supplying the 'pipe' value, which contains the device number. Add a way to find it directly from the emulated device. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/usb.h b/include/usb.h
index a09c7f199a..d68453109a 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -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
OpenPOWER on IntegriCloud