Re: [U-Boot] [PATCH v2 50/80] dm: usb: sandbox: Reset emulation devices in usb stop()

2015-04-07 Thread Simon Glass
On 25 March 2015 at 12:22, Simon Glass s...@chromium.org wrote:
 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 s...@chromium.org
 ---

 Changes in v2: None

  drivers/usb/host/usb-uclass.c | 11 +++
  1 file changed, 11 insertions(+)

Applied to u-boot-dm/next.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 50/80] dm: usb: sandbox: Reset emulation devices in usb stop()

2015-03-25 Thread Simon Glass
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 s...@chromium.org
---

Changes in v2: None

 drivers/usb/host/usb-uclass.c | 11 +++
 1 file changed, 11 insertions(+)

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;
-- 
2.2.0.rc0.207.ga3a616c

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot