usb: chipidea: Add platform flag for wrapper phy management
authorStephen Boyd <stephen.boyd@linaro.org>
Wed, 28 Dec 2016 22:56:52 +0000 (14:56 -0800)
committerPeter Chen <peter.chen@nxp.com>
Fri, 20 Jan 2017 03:25:02 +0000 (11:25 +0800)
The ULPI phy on qcom platforms needs to be initialized and
powered on after a USB reset and before we toggle the run/stop
bit. Otherwise, the phy locks up and doesn't work properly.
Therefore, add a flag to skip any phy power management in the
core layer, leaving it up to the glue driver to manage.

Acked-by: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/core.c
include/linux/usb/chipidea.h

index 24859b44c45c76ee7f3e7612d271875d340d1789..b399326db08f129864d5c62438fa95d6558e5ed2 100644 (file)
@@ -361,6 +361,9 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci)
  */
 static void ci_usb_phy_exit(struct ci_hdrc *ci)
 {
+       if (ci->platdata->flags & CI_HDRC_OVERRIDE_PHY_CONTROL)
+               return;
+
        if (ci->phy) {
                phy_power_off(ci->phy);
                phy_exit(ci->phy);
@@ -379,6 +382,9 @@ static int ci_usb_phy_init(struct ci_hdrc *ci)
 {
        int ret;
 
+       if (ci->platdata->flags & CI_HDRC_OVERRIDE_PHY_CONTROL)
+               return 0;
+
        switch (ci->platdata->phy_mode) {
        case USBPHY_INTERFACE_MODE_UTMI:
        case USBPHY_INTERFACE_MODE_UTMIW:
index f9be467d669531733b4889311029ac8d251a327e..d07b162073f72d82b0fb417e4cfbb02f760fb457 100644 (file)
@@ -57,6 +57,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_OVERRIDE_AHB_BURST     BIT(9)
 #define CI_HDRC_OVERRIDE_TX_BURST      BIT(10)
 #define CI_HDRC_OVERRIDE_RX_BURST      BIT(11)
+#define CI_HDRC_OVERRIDE_PHY_CONTROL   BIT(12) /* Glue layer manages phy */
        enum usb_dr_mode        dr_mode;
 #define CI_HDRC_CONTROLLER_RESET_EVENT         0
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT       1