From patchwork Wed Sep 7 21:35:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 75696 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp526033qgf; Wed, 7 Sep 2016 14:36:09 -0700 (PDT) X-Received: by 10.98.59.18 with SMTP id i18mr9238678pfa.98.1473284169490; Wed, 07 Sep 2016 14:36:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si40335838pab.38.2016.09.07.14.36.06; Wed, 07 Sep 2016 14:36:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932981AbcIGVfx (ORCPT + 8 others); Wed, 7 Sep 2016 17:35:53 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33353 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756724AbcIGVfa (ORCPT ); Wed, 7 Sep 2016 17:35:30 -0400 Received: by mail-pa0-f44.google.com with SMTP id cm16so9990377pac.0 for ; Wed, 07 Sep 2016 14:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6FBUwKsmFjxRsND6Y2FBBU+70wdkMFmJj8j3/1Zwk3E=; b=QDES8yN2sc3HnrQtWcyp5RP7NNjC7/yXyq3vkDJUdwV+W8iO449iz0b5RgBH6HpXWs pQKNheh8suD9pKK9rfkUaAsZ8ZBk+LTlp7G/aibB4QpEr3dqnfDQ00demU1w+abn7hcN 2xRCuXfpzYc3bf0slVt43QgEKc4OhpbViZCK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6FBUwKsmFjxRsND6Y2FBBU+70wdkMFmJj8j3/1Zwk3E=; b=LqyBMF/EnJDxthwIig7ObFzDh8jSjtCBAtYqGii05JfldN72JnfaE0NbJbQV2NDl5k RN/WlQq2vFi0pW0t/S6y4FrPA5MhHBiZlsmedgBMDrRNTTVPbPSSFzE04FPoUSbQCiD8 dEnqfp61R7XdF7a9PGSaCGdSLLkRZ84CoZMAeqF4Ioe8nDtI4otvA/pa40musrqgIjS2 ISIdNwF0ig+2nvvfqszNHCMpAAwJexP3SyZt+4EiF6FxdeK9SKl8Q/SKOP/j/EZ5SI2a e2Bp98XNkAv/g+LAT/h/dzCVQBKniiYTNnJiN2E6ljgcY1b6nam/JGmbUyBTDd9JYt1f 1BIA== X-Gm-Message-State: AE9vXwM4bJG3Bh6kL5rTB/IBltXHBM1C5ivf7GM4DW34gwHAvXNhvTq8IhN5m2HQCbxIGrK/ X-Received: by 10.66.88.135 with SMTP id bg7mr14511920pab.107.1473284129565; Wed, 07 Sep 2016 14:35:29 -0700 (PDT) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id 75sm51015417pfw.92.2016.09.07.14.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 14:35:29 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman Subject: [PATCH v4 06/22] usb: chipidea: Add platform flag for wrapper phy management Date: Wed, 7 Sep 2016 14:35:03 -0700 Message-Id: <20160907213519.27340-7-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160907213519.27340-1-stephen.boyd@linaro.org> References: <20160907213519.27340-1-stephen.boyd@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd --- drivers/usb/chipidea/core.c | 6 ++++++ include/linux/usb/chipidea.h | 1 + 2 files changed, 7 insertions(+) -- 2.9.0.rc2.8.ga28705d -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 01390e02ee53..532085a096d9 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -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: diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index f9be467d6695..d07b162073f7 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -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