Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6482644rwl; Thu, 29 Dec 2022 13:50:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrbKd9EucK3S/ayhsEfao6O2+26JLiCeVx2PqQc7EzjRtG/pS4EhZWjxaWJaUTqwdFZuEb X-Received: by 2002:a05:6402:2072:b0:487:6d4a:444c with SMTP id bd18-20020a056402207200b004876d4a444cmr7852266edb.28.1672350635858; Thu, 29 Dec 2022 13:50:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672350635; cv=none; d=google.com; s=arc-20160816; b=zkyK3qoSVyDmtA59ZiT+LR5Rv1Ek8I94IXsIbs112zSg+RF12nbj46BsRQv+4XTYUH rlH/+JHPDeKGzcxH3zyns4X2ne7eJi/o/0y3/piFHQ7gtLIXsh8507WbVQxQd6ldUzT+ 1HK446A6i9JOYOShv0Eam+yGH5PhLODPAZwRjy1S45+wZK6Aoeh+Da5ti2iVQcExR4BX op0GrsmFHiQu0tTszIEpU0d4EdsT6eg4kfoHjD9mRD9+xruaIEHlX1Hl4kz/BXb4EiOZ gUwQi942hXiEM+oIMmYGSGDwEbJLqpFDbRtqESfGi9lnqk1DYmlF8HMzFkXK3AUHzK5W BmQQ== 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=cQELnRpy1SY5PyLDwMbmrsmRP/hOwk6vEMc3pbubENM=; b=DzbqPKuTlNR84mJC2IeyoW4OchzJTCnQPverLdY/YELA0Tmc+EwnYcUtyqOlimXx9+ DXABeUYpTIxmMdbXrFUcd7kizu61LDL1Xbh9O3Cuup9WeepsnQoT1phAfvYi5Ar0GuLs aEXS74yrrpgV6thvDrioKt/tKAmOIi/DaJ8K00jj76P1TbG6xAhTH+2KKC7a6DBR+s5R 1NDyYvzd4ZbpynUNQupdKMTLapTkPeYyK8LK09cCSYX16txPFM8BuI86w3C+zHabeYOq s9ysQAIoeHsrF5JJBZ7KsX6cq3c86ixn9FCDbSQc2WT8DNfMvE9E+1RA2GeyeKUeraYl 3OjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=mUPrWc5I; 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 i7-20020a50fc07000000b0046b9715162asi15106476edr.6.2022.12.29.13.50.21; Thu, 29 Dec 2022 13:50:35 -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=mUPrWc5I; 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 S234146AbiL2VLY (ORCPT + 62 others); Thu, 29 Dec 2022 16:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiL2VLW (ORCPT ); Thu, 29 Dec 2022 16:11:22 -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 F051312745; Thu, 29 Dec 2022 13:11:19 -0800 (PST) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6061938c-b830-2fe0-2f4d-368e34c33676@linaro.org> 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 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). :-)