From patchwork Thu Jul 7 22:20:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9219709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0689607D9 for ; Thu, 7 Jul 2016 22:23:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C08EB28489 for ; Thu, 7 Jul 2016 22:23:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B52212848C; Thu, 7 Jul 2016 22:23:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EFD928489 for ; Thu, 7 Jul 2016 22:23:57 +0000 (UTC) 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 1bLHgM-0007pL-R3; Thu, 07 Jul 2016 22:22:06 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLHfz-0007el-9R for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2016 22:21:44 +0000 Received: by mail-pf0-x230.google.com with SMTP id i123so9703826pfg.0 for ; Thu, 07 Jul 2016 15:21:27 -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=gGJCXM2aF224WFc4H2+bKAZuWKUO7QITsr8YEqGy4P4=; b=TzxjX9RDChMKr8N/KLBoNChi4oa241Njh6E/j/cIgnUFtqDQJ7skprNNPJ/4g87Kxi 7qBxQMphb4zLtlb3Te7EuTGD2AwQhKyfuVj7sXReghmvb6ysTh8X8nYNeeWh5oBvbNWa lomywZ+QKGXpI8uczq72fXzWkiFMrIMUg8+Ns= 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=gGJCXM2aF224WFc4H2+bKAZuWKUO7QITsr8YEqGy4P4=; b=M+Ogbr5MqNhbboELZhNDXCnykwBz+9Xt49uIbYJ3+SGSBeOogLH45gLXKMqQDIbjXV nYyjRyjBgcuK4qZMn2Q2H7wky1E9eJ7SFOoupyJSVCiM9pA24YkWlV51lqvZySD4CdPe VVAu06HXf/9OTy9FNgVrU73A7A0cqEP0Rrg63ri3nZAzexLTSt465RRHKCaenvVS79uI Kbd4Mp4hsAKNgGZQcVKtqGjmK/IEjK7XSoL79m03xo8EW4+O7B6kh48cjuRjaAvx2p65 ZV5YnNtb57o/WW76hcoyipR7cKiSN8EYKDXaJXFGHYXnPN9apdyO+8FL4mEmT0dDQxHs QYTg== X-Gm-Message-State: ALyK8tKgrbt1LCBaLzxWNUA8KIiqIu3NbWiaANLnSStHLjneS8d43h/1f7Wa3t8wMngb8EGO X-Received: by 10.98.61.90 with SMTP id k87mr4301428pfa.86.1467930086832; Thu, 07 Jul 2016 15:21:26 -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 j8sm6781807paj.22.2016.07.07.15.21.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 15:21:26 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v2 06/22] usb: chipidea: Add platform flag for wrapper phy management Date: Thu, 7 Jul 2016 15:20:57 -0700 Message-Id: <20160707222114.1673-7-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160707222114.1673-1-stephen.boyd@linaro.org> References: <20160707222114.1673-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160707_152143_415593_29C95FAC X-CRM114-Status: GOOD ( 14.32 ) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Cc: Peter Chen Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd Acked-by: Peter Chen --- drivers/usb/chipidea/core.c | 6 ++++++ include/linux/usb/chipidea.h | 1 + 2 files changed, 7 insertions(+) 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