From patchwork Thu Sep 1 00:40:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 75150 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp20540qga; Wed, 31 Aug 2016 17:43:25 -0700 (PDT) X-Received: by 10.98.50.2 with SMTP id y2mr21963833pfy.138.1472690605052; Wed, 31 Aug 2016 17:43:25 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u79si2410619pfj.150.2016.08.31.17.43.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 17:43:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfG5F-00089d-L2; Thu, 01 Sep 2016 00:42:21 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfG41-0007YN-RF for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2016 00:41:07 +0000 Received: by mail-pa0-x22b.google.com with SMTP id cy9so23604750pac.0 for ; Wed, 31 Aug 2016 17:40:45 -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=MpyG2XkPcx9XrQKbXXeY71pW/eXxIPR36qlzQOdjnyQL+HdTPOglNuXcoGcpPW7GjB IB7ttsCflgfLqOCWSjS7lxCwL1NNNnFoPnZeLcgq9RXsTpI6VwcLTifgd92oU0Y3DFGW a+WB/0ghYCvLYvXa2DllrNdOkTP34qR5PKS6M= 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=bCAQH2pZmQyrgTriXk9RLMlXwMzXQRO5ECd2DrQEn4qdlSkweiPVUFA5SIrWTNE4oc b6skA06+Iz1h+SchjbZh9hUe/j9D6zESrhsOK6SnCEYiHfFce4p+gyfXRUR5ASjCoPPR NblElK8sh+PMZ5GH+j95zjs7PvI4M0N4Kmjynm4eIHfBvoxHR/DiSGxi2XuYULVBwT9h JiwMDV4katmHq4Dae8r6dSvPW5IeKRU7df6s6J4hyos+Q8YqEzPiivE6uAqlHgeappbr JBtHHBtkcXaiCMP4xf4ebalp+hG3Fx2s8Es8sExyyP9C8EvsFCmPj5zuv+lh1ig/EX/E A8aQ== X-Gm-Message-State: AE9vXwOr0YMQpJg1pA4xAu+sOglHD7+/OequAKqtap3kKg3EL3NI0TbEq9BSbF/1oE58WfPx X-Received: by 10.66.126.131 with SMTP id my3mr14038036pab.115.1472690444992; Wed, 31 Aug 2016 17:40:44 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id m5sm2292303paw.40.2016.08.31.17.40.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 17:40:44 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v3 06/22] usb: chipidea: Add platform flag for wrapper phy management Date: Wed, 31 Aug 2016 17:40:20 -0700 Message-Id: <20160901004036.23936-7-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160901004036.23936-1-stephen.boyd@linaro.org> References: <20160901004036.23936-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160831_174106_132648_B7A9DDF3 X-CRM114-Status: GOOD ( 13.69 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:22b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Arnd Bergmann , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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