Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6482425rwl; Thu, 29 Dec 2022 13:50:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXsmnq4e5myXHWivS0k8h5CxAUpv+24HuEYGXc2m8Sxg++FFADwjkL6dAQqkhpbj6dGy3cIE X-Received: by 2002:a17:907:d50d:b0:801:d6f2:754 with SMTP id wb13-20020a170907d50d00b00801d6f20754mr25327922ejc.52.1672350617802; Thu, 29 Dec 2022 13:50:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672350617; cv=none; d=google.com; s=arc-20160816; b=HeJkIbHKk7J5pqQTRpFiwBBoRkogxFvYpvrgj3LM9+kntAdarhg19m+1GHqVQXNLlO 3w7hVPSAxOJeBppxCAzn9DYgA9Lwvh9B42w0SFrZf9bYJ1qTorlf7ydJdOteqlwNnBmE x9jDtxLiySkbiUlFBhCpmepfAFWEU8ZheRoyV40KVHm7EJDj3WWfW23IkjWtcAheTo1U dyTAYgfXfNrwR5ewCDVcOLvmMp6tgTaeKxl5l/WkFIiGlCQmVYCcPyG3fT4y8btIcF1l C5Ql1DNkR+kOVbcYFANzMs+yr7P/gmfZb+1reJKLJa/Eh+/3tx/3Uqeix2BVpAlyXWmw aYrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NZfdUQnCbwEBRXq8TbX4UmVyB5v891dM32uRb8tYNWE=; b=DSsVQJSVGTkk0W7VkwUp4FSTEb7n98NTLVXuw8dz69Ni/ouive/UROMn2P8uPOf9xR J1mLgeS7/Xj2ZeoobbEAMbX0xMf3cd7/r1zZuynmZL+ZsrY98oLSYZg+BBSRfkLZNzJU UhClnDxl4IQKPlDwDSQZ+efNREoaPp/xLxoMhDVzJ3SjVVU0i6RteKxKFzCmEi2PkQVP aTyE/OyHhPNM3AQJ3Wc7KoEjmVJeJ8sqPsMGSl2TRsupXVGjO8GG5EBXgATI161SkSHb AiMQ8T+/4apkETDdBs8e4jwlVfs+F92DbZEICKXtOllzND/F5mgyBqLvOm8ajXlhxvPh r7VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=kbo+QtuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg3-20020a1709072cc300b0082b7e633998si16134358ejc.455.2022.12.29.13.50.03; Thu, 29 Dec 2022 13:50:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=kbo+QtuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234096AbiL2VDR (ORCPT + 62 others); Thu, 29 Dec 2022 16:03:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiL2VDO (ORCPT ); Thu, 29 Dec 2022 16:03:14 -0500 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C13C12AEA; Thu, 29 Dec 2022 13:03:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1672347783; 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=NZfdUQnCbwEBRXq8TbX4UmVyB5v891dM32uRb8tYNWE=; b=kbo+QtuFEn+EHHL+/lGnR8sLt3Tx20e7+O3ghi/7vU2Ppy8XbE4KkbhFk1Jiu3sBnr YNuUASGPN09MnK0JpuGRITxPLccSonqc6F8fC8aAQsPVSP3IB/ZXOoJ8uV1EUsFjqgMX v2Ax7GhJ3ttxysksW5Tv7TGTILr5QEZGOioMil1owHAWH4F4Pko3clr1IvCD2xf7/8WM tlmZFiIbcIV6htXBET04ji3eDuf9LhkwRXR3zT8GJL6s/iW82sQcnqWl/NFfw8Jon9nT Zlv5Ay/kjG5vA566dT6kmUMYxLre+mONgE/LoFLfLHygpqdaNAxQ7944W+DNLRsD7wI2 4Cow== 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 Yce349yBTL33Xpy (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 29 Dec 2022 22:03:03 +0100 (CET) Date: Thu, 29 Dec 2022 22:02:52 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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