Commit 3615a996ab91b5cdf8d89359150aff3d754db8d8
Committed by
Marek Vasut
1 parent
04025b42dc
Exists in
master
and in
53 other branches
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>
Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff
common/usb_hub.c
... | ... | @@ -44,6 +44,10 @@ |
44 | 44 | static struct usb_hub_device hub_dev[USB_MAX_HUB]; |
45 | 45 | static int usb_hub_index; |
46 | 46 | |
47 | +__weak void usb_hub_reset_devices(int port) | |
48 | +{ | |
49 | + return; | |
50 | +} | |
47 | 51 | |
48 | 52 | static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size) |
49 | 53 | { |
... | ... | @@ -425,6 +429,14 @@ |
425 | 429 | (le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_OVERCURRENT) ? \ |
426 | 430 | "" : "no "); |
427 | 431 | usb_hub_power_on(hub); |
432 | + | |
433 | + /* | |
434 | + * Reset any devices that may be in a bad state when applying | |
435 | + * the power. This is a __weak function. Resetting of the devices | |
436 | + * should occur in the board file of the device. | |
437 | + */ | |
438 | + for (i = 0; i < dev->maxchild; i++) | |
439 | + usb_hub_reset_devices(i + 1); | |
428 | 440 | |
429 | 441 | for (i = 0; i < dev->maxchild; i++) { |
430 | 442 | ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); |