Message ID | 20220715033454.58556-1-samuel@sholland.org |
---|---|
State | Accepted |
Commit | df202d996d72665c76d031849aa064c4881dc777 |
Delegated to: | Andre Przywara |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=iZorh71T; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=0m9OEN2J; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LkcSP2kW9z9s09 for <incoming@patchwork.ozlabs.org>; Fri, 15 Jul 2022 13:35:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 457648411A; Fri, 15 Jul 2022 05:35:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="iZorh71T"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="0m9OEN2J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 295BF84127; Fri, 15 Jul 2022 05:35:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3D38B840FB for <u-boot@lists.denx.de>; Fri, 15 Jul 2022 05:34:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7BF955C00FF; Thu, 14 Jul 2022 23:34:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 14 Jul 2022 23:34:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1657856096; x=1657942496; bh=uNjLrrK/pDmd7E81smMOD/1UZ E1TXO6M3/bDOuPJ7GI=; b=iZorh71TWCmZtfC+sBh+HsHp9h+XM8SzaeXaIeMPM Mz8FgGtXRHhosfRVuCupswON4VOM875wR5fomk2dAiigPpyk686dQ27nzfofI9H3 ORrY3OwHepBhUfCZig8jufkkM+7u5G/CsRAmneo5Q9UGlLtuHV83WdI11aRgWaD7 pylT9wxV5vpMUTRuyI+MCokmk1qTfWdcaLN66Xu9nopmY2VvvGNpr+nwVRNt32Z/ Tx9KocOZi0xCpdb/XfKZ8yte5A9cbbeUuVrZweHLguq5P1j6KMYQ9mtNNfXh5cds mcDStAAHFEa1MdLeLv1kVNae0hl9QO2N2fNIrd0bDY+mA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1657856096; x=1657942496; bh=uNjLrrK/pDmd7E81smMOD/1UZE1TXO6M3/b DOuPJ7GI=; b=0m9OEN2JXdeW1fmX5z4K5sDLalgCUmT+VNRP4NPCFiE/Y1dZwVI o5hXgUV1Il3FkrhM7errQU3TMXhXHbAPX1b4p2IZQkjzwBNbwt5ir8GxbznvbUFP CuuKCLJPnNU3qtZYiQ7tzjKcaWjvJ2BZ3GDkwsySjVaKDQ0DmShrJS8TerA9fObN 6/N2Cp8A3I3iSwnzEjqFVJ+UAbPvhoi3TDx8R6wnBTfVp0RcvYWZVK4PhXBY14Jz +vArMrBg949HpIC7C9HsJIbJu54RXAvbk11v2BlHur0pCfUuP3sz+Ag2IBmo1R1M LvrAEVYl/kuxQ4GZ1VzaW1g6+mYPxQEuXLQ== X-ME-Sender: <xms:X-DQYovShtc-R5xKmDw2etIdyHz-AzfVG5bJ0GKeaU0rn-fhhGBgbQ> <xme:X-DQYlejqs8eZLt4-LY9E5mg5QNt-L5elbel2hx96D5BBTQuwv6v9In-CF73dn3iM URl9lrX2XrUT6wvRQ> X-ME-Received: <xmr:X-DQYjwO_LepRGgfEvR33nry_HamjJdAbZ9aAclvdmS59wO0jD6fRBFt25sjw57c5SJ-qF7NCqc90fZ63_TgpkQqjLZI00lYRqKDAFuihHNrWC4O9sMPjNj_8F25LyM-8y3dyQ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudektddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepkeevlefhjeeuleeltedvjedvfeefteegleehueejffehgffffeekhefh hfekkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: <xmx:YODQYrNjTzdZqYFGmtiEkWJXF0w0MEhBK62ZaV3tfRFMEvMXEN8yFw> <xmx:YODQYo8JqD95WcUrjquHJfq62d9IE25NxhBQ_MysGe5b_Xm_YEzwFw> <xmx:YODQYjUo3WWUQfZOg2PHLFfYeaqNNMMxguMNR9283imfiywJqI-2ew> <xmx:YODQYnZ_zB1LLucamgcee26hIdyyLGRab-y8KIijbfCRGy5gAwfK_w> Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Jul 2022 23:34:55 -0400 (EDT) From: Samuel Holland <samuel@sholland.org> To: u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>, Andre Przywara <andre.przywara@arm.com> Cc: Samuel Holland <samuel@sholland.org>, Joe Hershberger <joe.hershberger@ni.com> Subject: [PATCH 1/2] phy: sun4i-usb: Do not drive VBUS with external VBUS present Date: Thu, 14 Jul 2022 22:34:53 -0500 Message-Id: <20220715033454.58556-1-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean |
Series |
[1/2] phy: sun4i-usb: Do not drive VBUS with external VBUS present
|
expand
|
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index aef2cb8f6f82..e1b01e732515 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -224,6 +224,12 @@ static int sun4i_usb_phy_power_on(struct phy *phy) initial_usb_scan_delay = 0; } + /* For phy0 only turn on Vbus if we don't have an ext. Vbus */ + if (phy->id == 0 && sun4i_usb_phy_vbus_detect(phy)) { + dev_warn(phy->dev, "External vbus detected, not enabling our own vbus\n"); + return 0; + } + if (dm_gpio_is_valid(&usb_phy->gpio_vbus)) dm_gpio_set_value(&usb_phy->gpio_vbus, 1);
It is possible to use host-side USB with externally-provided VBUS. For example, some USB OTG cables have an extra power input which powers both the board and the USB peripheral. To support this setup, skip enabling the VBUS switch/regulator if VBUS voltage is already present. This behavior matches the Linux PHY driver. Signed-off-by: Samuel Holland <samuel@sholland.org> --- drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++++++ 1 file changed, 6 insertions(+)