diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-25 12:22:38 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:26 -0600 |
commit | 095fdef081c77fc79c719031e28b2925523873c9 (patch) | |
tree | 6ede7b8c96a750f35a9b8e443787986cf8ee8e34 /drivers/usb | |
parent | 019808f97c1d039c41a960e477554b956c3ae238 (diff) | |
download | u-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.c | 11 |
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; |