From patchwork Tue Oct 18 01:56:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9381039 X-Patchwork-Delegate: agross@codeaurora.org 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 817D16086B for ; Tue, 18 Oct 2016 01:58:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69CBD28CCF for ; Tue, 18 Oct 2016 01:58:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CAFA28CDA; Tue, 18 Oct 2016 01:58:02 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1E9D28CCF for ; Tue, 18 Oct 2016 01:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933085AbcJRB5O (ORCPT ); Mon, 17 Oct 2016 21:57:14 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35034 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933417AbcJRB4q (ORCPT ); Mon, 17 Oct 2016 21:56:46 -0400 Received: by mail-pa0-f47.google.com with SMTP id qn10so66413420pac.2 for ; Mon, 17 Oct 2016 18:56:46 -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=AG3CCW5r8x+V7H6cTygAfVdtHDxr8JOYjm+n3R2gUro=; b=b3N5Hh60CMHEQGuq2gPLokB6tf7B8NucB168twfUpAeiz+H0dSaC9HtI3lCDsgH7qI +IWaCJwGJlJ/cUAcxNYPV64m5zD8+2OKv2XkTvbo9lT/H5LucpJh1HwgTMPA0kpwKGIq 6vY8YUfxgHeaRH0tOcUpM+PQlRm/GhBlI+oh8= 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=AG3CCW5r8x+V7H6cTygAfVdtHDxr8JOYjm+n3R2gUro=; b=aygdWSQz6OOCjern6gxlksqhlcWSSqMYIM9pVYKdf3fswaxPMzqAYmTlN/g3Jja+Ss 3V/LZnEz+Etm+OwIODSBnporUslTCyAEp2rTdjMx8gUl1timddkKpTBx/VapAuSn3tax yfW8LO8VPf16XjHlf6NkbykJl5hixLTydjbKM90Meue51mQQkcOo3ug885kLGyhnfefa +RrqKH+WL33macNuySQhfsYWZDe3aQJVuYEE2mGGjOIR1CUyoR2ys3MFQHC8dqqurwSz St0dLs8yYsbOe+Dc1DNx6q7jMlinfoCXZbh9s3eDweB6/Z461PLr0iO4jeedFY40EIQz C08A== X-Gm-Message-State: AA6/9RmgGbrLsu+/9+iJHth+p+GN2AzcGLlOzm+UX4Fq6KS76i3p3J3ABgAqWsPBuo5AJkbI X-Received: by 10.66.2.161 with SMTP id 1mr544454pav.199.1476755805623; Mon, 17 Oct 2016 18:56:45 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id j6sm51020430paa.44.2016.10.17.18.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 18:56:45 -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 v5 06/23] usb: chipidea: Add platform flag for wrapper phy management Date: Mon, 17 Oct 2016 18:56:19 -0700 Message-Id: <20161018015636.11701-7-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161018015636.11701-1-stephen.boyd@linaro.org> References: <20161018015636.11701-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 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. 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(+) 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