Message ID | 1427307788-7496-51-git-send-email-sjg@chromium.org |
---|---|
State | Accepted |
Delegated to: | Simon Glass |
Headers | show |
On 25 March 2015 at 12:22, Simon Glass <sjg@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 <sjg@chromium.org> > --- > > Changes in v2: None > > drivers/usb/host/usb-uclass.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) Applied to u-boot-dm/next.
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;
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> --- Changes in v2: None drivers/usb/host/usb-uclass.c | 11 +++++++++++ 1 file changed, 11 insertions(+)