summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2013-08-01 14:06:01 -0500
committerMarek Vasut <marex@denx.de>2013-08-26 21:56:34 +0200
commit3615a996ab91b5cdf8d89359150aff3d754db8d8 (patch)
tree052179c899cb8df574ad5bcad6c22e807f0c6d79
parent04025b42dc32b0f6437c24743b1c88b8ec43995a (diff)
USB: usb-hub: Add a weak function for resetting devices
Add a __weak function that can be overridden to reset devices attached to an ehci devices after the FEAT_POWER has been submitted Signed-off-by: Dan Murphy <dmurphy@ti.com>
-rw-r--r--common/usb_hub.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c
index a11b401e62..fd2b4ed4f4 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -44,6 +44,10 @@
static struct usb_hub_device hub_dev[USB_MAX_HUB];
static int usb_hub_index;
+__weak void usb_hub_reset_devices(int port)
+{
+ return;
+}
static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size)
{
@@ -426,6 +430,14 @@ static int usb_hub_configure(struct usb_device *dev)
"" : "no ");
usb_hub_power_on(hub);
+ /*
+ * Reset any devices that may be in a bad state when applying
+ * the power. This is a __weak function. Resetting of the devices
+ * should occur in the board file of the device.
+ */
+ for (i = 0; i < dev->maxchild; i++)
+ usb_hub_reset_devices(i + 1);
+
for (i = 0; i < dev->maxchild; i++) {
ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
unsigned short portstatus, portchange;