From patchwork Wed Dec 28 22:56:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9490775 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 DB17262AB0 for ; Wed, 28 Dec 2016 23:02:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C60E626242 for ; Wed, 28 Dec 2016 23:02:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA97926419; Wed, 28 Dec 2016 23:02:44 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 1872D26242 for ; Wed, 28 Dec 2016 23:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbcL1XCk (ORCPT ); Wed, 28 Dec 2016 18:02:40 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:32770 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbcL1W5W (ORCPT ); Wed, 28 Dec 2016 17:57:22 -0500 Received: by mail-pg0-f49.google.com with SMTP id g1so120719130pgn.0 for ; Wed, 28 Dec 2016 14:57:21 -0800 (PST) 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=Hxbj295a7x+ySVINeBBbvwkPn/3mSss2SNkkqGFMsJg=; b=UjSyE93QX+agH6ogWTudCiZAAATIjTbSYMPKuJfmUehwAmCC0D6/y+FZHXIOEQgxhu MNJPEPppCWbe2Ay1aOXibBsdRL17inNXQIV+qLb2pf/vP+dKzoU7srRn2qEXg3EUkBfe 0/ANebVUM62LcIvykCzTyZqf4NyM9xSEd7Jsc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hxbj295a7x+ySVINeBBbvwkPn/3mSss2SNkkqGFMsJg=; b=Vtllz91v+u1FQE1B+xRXPWLTgEvQYCV92v+I7x3YBTQK9s3OrXtOuZG+izcicZ/FG7 e9ogeZeDkm5wiRcQqDwCtFJ7qlyauQzGk5Rt5kvr/VEoe8iyY0Ak22GstUEGOy/DA7G+ 3PepX784+WUmMFvRQOCB6Ww/3Z/OYss9Ru3uBeyDDXnLplPa3d15KF1yGPyRf60RbSkY qYACBy53Ba26+5EKNNlNf5NiBskiuRkMrl7flbwQFTRQ1TeC+uOTeBq0h6iJD9R3Xotp i3Mj1ShlEceGqjxHxMsNUlvPgrwvQrvJScyMqDpw8MvPyYqALnESMwD75OdGmkNOtkMW Qxpw== X-Gm-Message-State: AIkVDXJfjgpIksFEWbqYfXHL+2eQSsisMV7MdQ9g4DLSy2NDZXp6BNah/snG6HVjY29uMbrw X-Received: by 10.98.21.148 with SMTP id 142mr36031316pfv.38.1482965840662; Wed, 28 Dec 2016 14:57:20 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id x4sm100355741pgc.14.2016.12.28.14.57.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Dec 2016 14:57:20 -0800 (PST) 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 v6 06/25] usb: chipidea: Add platform flag for wrapper phy management Date: Wed, 28 Dec 2016 14:56:52 -0800 Message-Id: <20161228225711.698-7-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161228225711.698-1-stephen.boyd@linaro.org> References: <20161228225711.698-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 6e0d614a8075..3d15aee84a6a 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