From 862e75c0dbb578ec2e1f374794007048f3dd29c6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 25 Mar 2015 12:22:04 -0600 Subject: dm: usb: Refactor port resets Move the port reset code into its own function. Rename usb_hub_reset() to indicate that is is now a legacy function. Signed-off-by: Simon Glass Reviewed-by: Marek Vasut --- include/usb.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/usb.h') diff --git a/include/usb.h b/include/usb.h index 8cedaa23f8..9625148b51 100644 --- a/include/usb.h +++ b/include/usb.h @@ -700,9 +700,25 @@ bool usb_device_has_child_on_port(struct usb_device *parent, int port); int usb_hub_probe(struct usb_device *dev, int ifnum); void usb_hub_reset(void); -int hub_port_reset(struct usb_device *dev, int port, + +/** + * legacy_hub_port_reset() - reset a port given its usb_device pointer + * + * Reset a hub port and see if a device is present on that port, providing + * sufficient time for it to show itself. The port status is returned. + * + * With driver model this moves to hub_port_reset() and is passed a struct + * udevice. + * + * @dev: USB device to reset + * @port: Port number to reset (note ports are numbered from 0 here) + * @portstat: Returns port status + */ +int legacy_hub_port_reset(struct usb_device *dev, int port, unsigned short *portstat); +int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat); + /** * usb_alloc_new_device() - Allocate a new device * -- cgit