USB: ehci-omap: Tweak PHY initialization sequence
authorRoger Quadros <rogerq@ti.com>
Fri, 14 Jun 2013 13:52:07 +0000 (16:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jul 2013 01:21:24 +0000 (18:21 -0700)
commit 4e5c9e6fa2d232a0686d5fe45cd1508484048936 upstream.

For PHY mode, the PHYs must be brought out of reset
before the EHCI controller is started.

This patch fixes the issue where USB devices are not found
on Beagleboard/Beagle-xm if USB has been started previously
by the bootloader. (e.g. by "usb start" command in u-boot)

Tested on Beagleboard, Beagleboard-xm and Pandaboard.

Issue present on 3.10 onwards.

Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-omap.c

index 16d7150e855722be6bc143c504d31120adf53f83..dda408f2c6e93942d64a9d7a88b3b00f7c0d3a67 100644 (file)
@@ -187,6 +187,12 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
                }
 
                omap->phy[i] = phy;
+
+               if (pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) {
+                       usb_phy_init(omap->phy[i]);
+                       /* bring PHY out of suspend */
+                       usb_phy_set_suspend(omap->phy[i], 0);
+               }
        }
 
        pm_runtime_enable(dev);
@@ -211,13 +217,14 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
        }
 
        /*
-        * Bring PHYs out of reset.
+        * Bring PHYs out of reset for non PHY modes.
         * Even though HSIC mode is a PHY-less mode, the reset
         * line exists between the chips and can be modelled
         * as a PHY device for reset control.
         */
        for (i = 0; i < omap->nports; i++) {
-               if (!omap->phy[i])
+               if (!omap->phy[i] ||
+                    pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY)
                        continue;
 
                usb_phy_init(omap->phy[i]);