diff mbox

[U-Boot,v2,12/15] usb: hub: Call usb_update_hub_device() after hub descriptor is fetched

Message ID 1499848685-17108-13-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Bin Meng July 12, 2017, 8:38 a.m. UTC
After fetching hub descriptor, we need to call USB uclass operation
update_hub_device() to notify HCD to do some preparation work.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 common/usb_hub.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/common/usb_hub.c b/common/usb_hub.c
index bbb1155..70bc6e2 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -789,6 +789,17 @@  static int usb_hub_configure(struct usb_device *dev)
 
 #ifdef CONFIG_DM_USB
 	/*
+	 * Update USB host controller's internal representation of this hub
+	 * after the hub descriptor is fetched.
+	 */
+	ret = usb_update_hub_device(dev);
+	if (ret < 0 && ret != -ENOSYS) {
+		debug("%s: failed to update hub device for HCD (%x)\n",
+		      __func__, ret);
+		return ret;
+	}
+
+	/*
 	 * A maximum of seven tiers are allowed in a USB topology, and the
 	 * root hub occupies the first tier. The last tier ends with a normal
 	 * USB device. USB 3.0 hubs use a 20-bit field called 'route string'