summaryrefslogtreecommitdiff
path: root/include/usb.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-25 12:22:04 -0600
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:20 -0600
commit862e75c0dbb578ec2e1f374794007048f3dd29c6 (patch)
tree0358873bc0ccfe7219a2aa526f5613d530a335f9 /include/usb.h
parent53d8aa0f612325abb5754b8cbf33170e89f08b1e (diff)
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 <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h18
1 files changed, 17 insertions, 1 deletions
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
*