]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
usb: hub: identify the hub-device to usb_hub_reset_devices
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 22 Nov 2017 16:15:17 +0000 (17:15 +0100)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 26 Nov 2017 01:22:36 +0000 (02:22 +0100)
When usb_hub_reset_devices is called, it should be passed both an
indicator which hub it should operate on and what port number (local
to that hub) should be reset.

Previously, the usb_hub.c code did not include such context and
always started resets from port number 1, performing multiple
reset-requests for the same devices:

       /*
        * 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);

This adds an additional 'hub' parameter to usb_hub_reset_devices
that provides the context to fully qualify the port-number in.

Existing implementations are changed to accept and ignore the new
parameter.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
board/compulab/cm_t54/cm_t54.c
board/ti/omap5_uevm/evm.c
common/usb_hub.c

index 31730a4d1ca1f1782b3c8c87245af3beb8793045..3e6235a3b7e05eaa5939dd6769beb85e427590e6 100644 (file)
@@ -246,7 +246,7 @@ int ehci_hcd_stop(void)
        return ret;
 }
 
-void usb_hub_reset_devices(int port)
+void usb_hub_reset_devices(struct usb_hub_device *hub, int port)
 {
        /* The LAN9730 needs to be reset after the port power has been set. */
        if (port == 3) {
index 4b25cc2d7c3cec8ce3c85dfcdf46695b36d570f3..67242f5cc8389d22dc71d12242008fd0054daaa7 100644 (file)
@@ -249,7 +249,7 @@ int ehci_hcd_stop(void)
        return omap_ehci_hcd_stop();
 }
 
-void usb_hub_reset_devices(int port)
+void usb_hub_reset_devices(struct usb_hub_device *hub, int port)
 {
        /* The LAN9730 needs to be reset after the port power has been set. */
        if (port == 3) {
index 325d16dfc8682d3b5cc0e950e04d80d24ab0861e..024dadb27741f4f3953f337b85ed578f1797c165 100644 (file)
@@ -57,7 +57,7 @@ struct usb_device_scan {
 
 static LIST_HEAD(usb_scan_list);
 
-__weak void usb_hub_reset_devices(int port)
+__weak void usb_hub_reset_devices(struct usb_hub_device *hub, int port)
 {
        return;
 }
@@ -853,7 +853,7 @@ static int usb_hub_configure(struct usb_device *dev)
         * should occur in the board file of the device.
         */
        for (i = 0; i < dev->maxchild; i++)
-               usb_hub_reset_devices(i + 1);
+               usb_hub_reset_devices(hub, i + 1);
 
        /*
         * Only add the connected USB devices, including potential hubs,