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: 92107 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp199239obz; Fri, 20 Jan 2017 10:51:50 -0800 (PST) X-Received: by 10.98.13.203 with SMTP id 72mr18119751pfn.64.1484938310270; Fri, 20 Jan 2017 10:51:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d137si3832635pfd.198.2017.01.20.10.51.49; Fri, 20 Jan 2017 10:51:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbdATSvi (ORCPT + 25 others); Fri, 20 Jan 2017 13:51:38 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34310 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753063AbdATSvE (ORCPT ); Fri, 20 Jan 2017 13:51:04 -0500 Received: by mail-pf0-f179.google.com with SMTP id e4so24307712pfg.1 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=KP8xRPtGd+Jg5imjHvMAwjmLYiTKfjS7z4dMFz9rGh4dFMH+DfG8B2g3lE0Ow2pXcI 2eeEvc6FC/UCp7nllRXS6Czg1G2ElGq9pNE3MtJgQRPr8hcM1YT8lYrk6wMyIr+ut1Bo gt4NmZuFNbJ5dOE2IxHt7lD3CZc20LvecTyNa2XiviQ39wX8s2Xg8ngr50Gy6N5tEd/8 OGJ3fqctd0cwqUHC0BrJdiIhELUtsaqAXu6qfN9JQxOY+tc2mue1vv4qL7Z9LKuCAbbZ HrmHYAzNDQhpBcFEomzDyB0v+gsNWeWGQAJMG8tuZpqwbEp5PBWWT5XBVhvJpLAlGrmG faEw== X-Gm-Message-State: AIkVDXLLZjYcl/JaOfe933m7naEVoVQ8lFVd3aNerNIh4lgWMvRtQEhWoAUW2NjUVv+01/vb 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.10.0.297.gf6727b0 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); + } } /**