From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDA7EC3DA79 for ; Thu, 29 Dec 2022 21:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OK5gWw1VeeMSFK1Yozp4Nbt2jiM8LEqjDlgfsVBGcSA=; b=3mUMzV8RIuezY8 hQSHdhWKkQ8HiiBs4E+bvZJ9/glxWnoPwRqZYTCEzMMw0WNLXPX+Sb1ENyzcDLS8AjEqqwQOBSD31 0RaeEaHybBMrOICSSiUurEvR1nGYniKZvfhdNbxA+Uorj06roaryB81uxRt8eB+hErkRXZhlSlQg+ KjUKv8PW5oRppt5vO/W+g0X1m4HPro7R3iegJ/2g/PzIlvguZ5khfB9GXhs96c4XFUsy4viYBBowb fN9TCuszq1JlhbJED/g0icW9szeNNPBWaNRu19YwqhVWdOt2gNBHC4dd/HGsYe63vgBxTvjXjK0DI OiW1YWpV8pOuWMRhK2ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pB0BP-00273A-1G; Thu, 29 Dec 2022 21:11:23 +0000 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pB0BB-0026wy-2M for linux-phy@lists.infradead.org; Thu, 29 Dec 2022 21:11:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1672348266; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=cQELnRpy1SY5PyLDwMbmrsmRP/hOwk6vEMc3pbubENM=; b=mUPrWc5IljxIRvNQW1luLAz1CXsZwdkyaxHlsV0iakKXM2c97WnsZQDVgfc561KRRf AmaCmZt7qchNUJjF8JRtP7J10BVFxO9AfG7SF6NhQp4rc/Nari+H1ud5fG/TMuHbv6Pe ElC4QCATBTxM8X1MldqTduMSjiSq1FQ6s6JJjEIiJqkVmtp3G5n62SxtqwBVxA9l4D29 Mqzg4e/WBdysKUrdFGpbkZlZ44nvKGyPXoakpbKvngeqPnxxT04moIS9E0RJJtKT8Ybc CoJsEXtidIY2lG/xE13h3SQvrTIkU/wqooVgOy/F4nTnLy+8DA71iNapQDYVSMgLJuyK FB0g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u261EJF5OxJAhdlWyvDI" X-RZG-CLASS-ID: mo00 Received: from gerhold.net by smtp.strato.de (RZmta 48.2.1 DYNA|AUTH) with ESMTPSA id Yce349yBTLB5XqR (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 29 Dec 2022 22:11:05 +0100 (CET) Date: Thu, 29 Dec 2022 22:11:04 +0100 From: Stephan Gerhold To: Bryan O'Donoghue Cc: agross@kernel.org, andersson@kernel.org, vkoul@kernel.org, kishon@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 2/2] phy: qcom-usb-hs: Add qcom,dp-manual-pullup logic Message-ID: References: <20221229183410.683584-1-bryan.odonoghue@linaro.org> <20221229183410.683584-3-bryan.odonoghue@linaro.org> <6061938c-b830-2fe0-2f4d-368e34c33676@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6061938c-b830-2fe0-2f4d-368e34c33676@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221229_131109_402973_7A971A77 X-CRM114-Status: GOOD ( 28.51 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Thu, Dec 29, 2022 at 09:05:23PM +0000, Bryan O'Donoghue wrote: > On 29/12/2022 21:02, Stephan Gerhold wrote: > > On Thu, Dec 29, 2022 at 08:45:15PM +0100, Stephan Gerhold wrote: > > > On Thu, Dec 29, 2022 at 06:34:10PM +0000, Bryan O'Donoghue wrote: > > > > Downstream has a flag called qcom,dp-manual-pullup which informs the > > > > downstream driver if it should toggle ULPI_MISC_A_VBUSVLDEXTSEL and > > > > ULPI_MISC_A_VBUSVLDEXT. > > > > > > > > Downstream states: > > > > > > > > "qcom,dp-manual-pullup: If present, vbus is not routed to USB > > > > controller/phy and controller driver therefore enables pull-up > > > > explicitly before starting controller using usbcmd run/stop bit." > > > > > > > > Working with a system that has both an external Type-C port controller and > > > > an internal USB Hub results in a situation where VBUS is not connected to > > > > the SoC. > > > > > > > > In this case we still need to set the DP pullup. > > > > > > > > This patch enables and disables the DP pullup on PHY power_on and power_off > > > > respectively if the DT has declared the bool "qcom,enable-vbus-pullup" > > > > effectively replicating the downstream logic to the same effect. > > > > > > > > Signed-off-by: Bryan O'Donoghue > > > [...] > > > > > > An alternative that I've occasionally used for early bring-up is to > > > simply use a dummy extcon driver [1] that permanently reports active > > > VBUS. The end result is the same. While it's clearly a hack perhaps this > > > makes it a bit more clear that ideally you really should try to assign > > > an extcon device, to avoid keeping the USB controller and PHY on > > > permanently. > > > > > > > BTW another nice trick that should work in all almost all cases is to > > use the state of the PMIC USB_IN pin as VBUS detection. All battery- > > powered devices I have seen route the USB VBUS to PM8916 USB_IN. And > > even many boards like DB410c seem to do that or at least permanently > > supply 5V there. In all these cases the &pm8916_usbin extcon will > > report a VBUS state that should make USB work. > > > > Have you tried using that on your MSM8939 board with the Type-C setup? > > > > &pm8916_usbin { > > status = "okay"; > > }; > > > > &usb { > > status = "okay"; > > usb-role-switch; > > extcon = <&pm8916_usbin>; > > }; > > > > &usb_hs_phy { > > extcon = <&pm8916_usbin>; > > }; > > > > Stephan > > I checked USBIN before my last email reply. > > Its possible its connected but its not there on the 8939 schematic I have. > Then it doesn't seem to be a particularly complete schematic. :-) PM8916 definitely has USB_IN pads (pad # N13, P13). :-) -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy