summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-10-01 06:19:40 -0700
committerMarek Vasut <marex@denx.de>2017-10-01 16:32:51 +0200
commit848436a48d21447fc78bef67a4cbf11392536de2 (patch)
tree55e19875f5bb5c3b5b72af3faad3cbce3c080af9 /include
parent84aa8536f0197e439832f56cc7b554af488fc3c8 (diff)
downloadu-boot-848436a48d21447fc78bef67a4cbf11392536de2.tar.gz
u-boot-848436a48d21447fc78bef67a4cbf11392536de2.tar.bz2
u-boot-848436a48d21447fc78bef67a4cbf11392536de2.zip
usb: emul: Expose find_descriptor() as a public API
This can be useful outside of the sandbox usb emulation uclass driver. Expose it as a public API with a proper prefix (usb_emul_). Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/usb.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/usb.h b/include/usb.h
index 63eddddc91..3766514635 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -1056,6 +1056,17 @@ int usb_emul_find(struct udevice *bus, ulong pipe, int port1,
int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp);
/**
+ * usb_emul_find_descriptor() - Find a USB descriptor of a particular device
+ *
+ * @ptr: a pointer to a list of USB descriptor pointers
+ * @type: type of USB descriptor to find
+ * @index: if @type is USB_DT_CONFIG, this is the configuration value
+ * @return a pointer to the USB descriptor found, NULL if not found
+ */
+struct usb_generic_descriptor **usb_emul_find_descriptor(
+ struct usb_generic_descriptor **ptr, int type, int index);
+
+/**
* usb_emul_reset() - Reset all emulators ready for use
*
* Clear out any address information in the emulators and make then ready for