diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2017-07-19 13:51:11 (GMT) |
---|---|---|
committer | Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> | 2017-08-08 08:42:23 (GMT) |
commit | 8f967498d9f7fb19167445fd32be0fc48018edb7 (patch) | |
tree | ffd9bded300ed27220192052f733eb7294ca888b /include/usb.h | |
parent | 7b23d9c59fe85db47b3be25ee0da72b1d9d9f022 (diff) | |
download | u-boot-8f967498d9f7fb19167445fd32be0fc48018edb7.tar.xz |
usb: hub: Add a new API to test if a hub device is root hub
Sometimes we need know if a given hub device is root hub or not.
Add a new API to test this. This removes the xHCI driver's own
version is_root_hub() and change to use the new API.
While we are here, remove the unused/commented out get_usb_device()
in the xHCI driver too.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/usb.h')
-rw-r--r-- | include/usb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/usb.h b/include/usb.h index a266677..64dfa84 100644 --- a/include/usb.h +++ b/include/usb.h @@ -776,6 +776,14 @@ int usb_setup_device(struct usb_device *dev, bool do_read, struct usb_device *parent); /** + * usb_hub_is_root_hub() - Test whether a hub device is root hub or not + * + * @hub: USB hub device to test + * @return: true if the hub device is root hub, false otherwise. + */ +bool usb_hub_is_root_hub(struct udevice *hub); + +/** * usb_hub_scan() - Scan a hub and find its devices * * @hub: Hub device to scan |