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: 9529253 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 1F13060434 for ; Fri, 20 Jan 2017 18:51:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 137522040D for ; Fri, 20 Jan 2017 18:51:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07B53286A2; Fri, 20 Jan 2017 18:51:52 +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 9165D2040D for ; Fri, 20 Jan 2017 18:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbdATSvh (ORCPT ); Fri, 20 Jan 2017 13:51:37 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36006 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067AbdATSvE (ORCPT ); Fri, 20 Jan 2017 13:51:04 -0500 Received: by mail-pf0-f175.google.com with SMTP id 189so24392445pfu.3 for ; Fri, 20 Jan 2017 10:51: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=mtedc40ppCFSiUQ1v/twl3W9VRhKnL4bUo5EIsn3vNucrDuPMI30U4g2SPo5fuUJqS owW6MzOoeBXqPc503Z8dQQsgSNQ9snA7G9bNxbn/w8/wmWERRxjE7sYbRsup9GtfKmqf eJJ+mxJ3ysO1B5n7CuVZ370LKtPxvKzKvAXAL+K9YIhPpj8dAkupM/vI7HFbVp+c1ce+ qjFc1RMQGjGAVCkEKb4Lk8vJhJRgPZWFoH7m924YOfwj/3TvkIjVzzJM/1oXwxBIKXSA i7LlZWzXLCPaMPoIqEl42KG0FM7FPccwwWavfC7RnTrTkli93NiMFruiaZ+x7tW0mEoT iBAQ== X-Gm-Message-State: AIkVDXI7jUsvRLUz1xOytkVeDkW86W85+erHJHw6RqWZwnZVPyPAi9iXhAOiJ4p0lj8Vp0Wg 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 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 , linux-usb@vger.kernel.org, Greg Kroah-Hartman 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> 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 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); + } } /**