diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-02 10:27:25 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-20 10:07:16 +0100 |
commit | c4dcbcd30f046d6411cb0d789ad94056b935f26b (patch) | |
tree | c05841b9a07d093aedf6bc79a60ac1c7ab9b7fcf /drivers/usb/core/usb.c | |
parent | 4569ddd9130ecb475b224ffbc6851e0b4c471028 (diff) | |
download | barebox-c4dcbcd30f046d6411cb0d789ad94056b935f26b.tar.gz barebox-c4dcbcd30f046d6411cb0d789ad94056b935f26b.tar.xz |
usb: support set hub depth request for USB 3.0 hubs
This is an adoption of U-Boot commit bbc6f06c0031249bf1983b875e54cb7549bafe60:
| commit bbc6f06c0031249bf1983b875e54cb7549bafe60
| Author: Bin Meng <bmeng.cn@gmail.com>
| Date: Wed Jul 19 21:51:13 2017 +0800
|
| usb: hub: Support 'set hub depth' request for USB 3.0 hubs
|
| USB 3.0 hub uses a hub depth value multiplied by four as an offset
| into the 'route string' to locate the bits it uses to determine the
| downstream port number. We shall set the hub depth value of a USB
| 3.0 hub after it is configured.
|
| Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
In this patch we also support recording the depth of a hub in
struct usb_device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r-- | drivers/usb/core/usb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 06087d2df6..b94f7978a3 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -350,6 +350,9 @@ int usb_new_device(struct usb_device *dev) dev->epmaxpacketin[0] = 64; dev->epmaxpacketout[0] = 64; + if (parent) + dev->level = parent->level + 1; + err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64); if (err < 0) { dev_dbg(&dev->dev, "%s: usb_get_descriptor() failed with %d\n", __func__, err); |