summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-25 12:22:38 -0600
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:26 -0600
commit095fdef081c77fc79c719031e28b2925523873c9 (patch)
tree6ede7b8c96a750f35a9b8e443787986cf8ee8e34 /drivers/usb
parent019808f97c1d039c41a960e477554b956c3ae238 (diff)
downloadu-boot-imx-095fdef081c77fc79c719031e28b2925523873c9.zip
u-boot-imx-095fdef081c77fc79c719031e28b2925523873c9.tar.gz
u-boot-imx-095fdef081c77fc79c719031e28b2925523873c9.tar.bz2
dm: usb: sandbox: Reset emulation devices in usb stop()
These devices must have their addresses removed ready for the next USB bus enumeration. Add this logic to usb_stop(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/usb-uclass.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 29ef5d9..714bc0e 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -93,6 +93,17 @@ int usb_stop(void)
err = ret;
}
+#ifdef CONFIG_SANDBOX
+ struct udevice *dev;
+
+ /* Reset all enulation devices */
+ ret = uclass_get(UCLASS_USB_EMUL, &uc);
+ if (ret)
+ return ret;
+
+ uclass_foreach_dev(dev, uc)
+ usb_emul_reset(dev);
+#endif
usb_stor_reset();
usb_hub_reset();
usb_started = 0;