From patchwork Fri Jan 20 18:50:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9529265 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 5F76360463 for ; Fri, 20 Jan 2017 18:53:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 543DE2868F for ; Fri, 20 Jan 2017 18:53:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 487D9286B4; Fri, 20 Jan 2017 18:53:12 +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=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D214286A2 for ; Fri, 20 Jan 2017 18:53:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cUeJ8-0002qu-8z; Fri, 20 Jan 2017 18:53:06 +0000 Received: from mail-pf0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cUeIP-000205-Ed for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2017 18:52:23 +0000 Received: by mail-pf0-f171.google.com with SMTP id y143so24372683pfb.0 for ; Fri, 20 Jan 2017 10:52:04 -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=GYsYXqztIk+Y2jiL4EIDnC3RFFOTx/R/cAAyKisUa4I=; b=VKW+hFfi7JM+bUBnEs2uMeBrp/rCCYPhaO5WuDnajsaIs8TIjI/TlQUoSd63b1Ro0z IgK7GGCabYAH4g2x70Di6zyahQuXgtw4Cu9gkG1MLCuvH+p4OpAfCzWseNTG1IOik0Us ZhCFptLx/f8f/P5BK9A3kkywiGWurbzCipej0= 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=GYsYXqztIk+Y2jiL4EIDnC3RFFOTx/R/cAAyKisUa4I=; b=XXJ+bKcIKumPJoUXGCmn8SjqF+4VqgZOI9ElWXbGOh14LkpkW0P8lUGE6Rn0LlA5A6 jw7wuURvcRbGBj73YmM0qogvYaY0vAPzTz4mcdQ8/Nv6c2Vvw11E4wEFcV9k3UH1RoIJ y5wejBi2av9f/8M/9iMTADF7e1T/0G8zhLpyQwOBnbeEfbX/A+/mZhVZZzYWyQFUyzrl A5D6qjwoebgC29FdCog291OEPdPVjjQxmAm3l3aBRhLhVv92Vdqjz08Ob0rtJlOwcfJB 3BUy351o16Vj9qQNyNGlN9uROPrbJwUWLW4ARpiqJuEpaWeX9rEaNPjUQN460DoZxMn0 slQQ== X-Gm-Message-State: AIkVDXIJUI4arGzp5uuxVr2x3/u1KMaPLThg5Qz8xIZKykvDxS+U3LH+PBn9HyduGMUrlYRl X-Received: by 10.98.87.142 with SMTP id i14mr17951011pfj.85.1484938263983; Fri, 20 Jan 2017 10:51:03 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id j78sm18574274pfk.39.2017.01.20.10.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Jan 2017 10:51:03 -0800 (PST) From: Stephen Boyd To: Peter Chen , Kishon Vijay Abraham I Subject: [PATCH v7 4/5] usb: chipidea: Signal vbus state to phy Date: Fri, 20 Jan 2017 10:50:56 -0800 Message-Id: <20170120185057.16206-5-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20170120185057.16206-1-stephen.boyd@linaro.org> References: <20170120185057.16206-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170120_105221_633071_210B5957 X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , 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 Some USB PHYs need to be told about vbus changing state explicitly. For example the qcom USB HS PHY needs to toggle a bit when vbus goes from low to high (VBUSVLDEXT) to cause the "session valid" signal to toggle. This signal will pull up D+ when the phy starts running. Add the appropriate phy_set_vbus() call here to signal vbus state changes to the phy. Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd --- New patch drivers/usb/chipidea/otg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index 10236fe71522..6ea702beed48 100644 --- a/drivers/usb/chipidea/otg.c +++ b/drivers/usb/chipidea/otg.c @@ -134,10 +134,13 @@ void ci_handle_vbus_change(struct ci_hdrc *ci) if (!ci->is_otg) return; - if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) + if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) { usb_gadget_vbus_connect(&ci->gadget); - else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active) + phy_set_vbus(ci->phy, 1); + } else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active) { + phy_set_vbus(ci->phy, 0); usb_gadget_vbus_disconnect(&ci->gadget); + } } /**