diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2017-07-19 13:51:17 (GMT) |
---|---|---|
committer | Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> | 2017-08-08 08:42:23 (GMT) |
commit | c4a5c1226b2b84f3a0d5b40cebb15393e8f39589 (patch) | |
tree | 02a00149eecfb0ff934dfd0b227c610f0e7df766 /include/usb.h | |
parent | fe06ef4214879ab21db55a00b58ef1e07cbe0fb6 (diff) | |
download | u-boot-c4a5c1226b2b84f3a0d5b40cebb15393e8f39589.tar.xz |
dm: usb: Add a new USB controller operation 'update_hub_device'
For USB host controllers like xHC, its internal representation of
hub needs to be updated after the hub descriptor is fetched. This
adds a new op that does this.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/usb.h')
-rw-r--r-- | include/usb.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/usb.h b/include/usb.h index 58b4549..fad0401 100644 --- a/include/usb.h +++ b/include/usb.h @@ -758,6 +758,14 @@ struct dm_usb_ops { * reset_root_port() - Reset usb root port */ int (*reset_root_port)(struct udevice *bus, struct usb_device *udev); + + /** + * update_hub_device() - Update HCD's internal representation of hub + * + * After a hub descriptor is fetched, notify HCD so that its internal + * representation of this hub can be updated (xHCI) + */ + int (*update_hub_device)(struct udevice *bus, struct usb_device *udev); }; #define usb_get_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops) @@ -931,6 +939,17 @@ int usb_new_device(struct usb_device *dev); int usb_alloc_device(struct usb_device *dev); /** + * update_hub_device() - Update HCD's internal representation of hub + * + * After a hub descriptor is fetched, notify HCD so that its internal + * representation of this hub can be updated. + * + * @dev: Hub device + * @return 0 if OK, -ve on error + */ +int usb_update_hub_device(struct usb_device *dev); + +/** * usb_emul_setup_device() - Set up a new USB device emulation * * This is normally called when a new emulation device is bound. It tells @@ -943,7 +962,7 @@ int usb_alloc_device(struct usb_device *dev); * @desc_list: List of points or USB descriptors, terminated by NULL. * The first entry must be struct usb_device_descriptor, * and others follow on after that. - * @return 0 if OK, -ve on error + * @return 0 if OK, -ENOSYS if not implemented, other -ve on error */ int usb_emul_setup_device(struct udevice *dev, int maxpacketsize, struct usb_string *strings, void **desc_list); |