Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1682503rwb; Thu, 10 Nov 2022 21:32:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5oCDHnJ4Y0Et6Ygrz5fC7aL6PVSCA+r9n7FYbgAXGD5ouEOKSntPTie+Vh+Bx9dg51j+OK X-Received: by 2002:a63:40c:0:b0:470:275b:aff3 with SMTP id 12-20020a63040c000000b00470275baff3mr237730pge.522.1668144757305; Thu, 10 Nov 2022 21:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668144757; cv=none; d=google.com; s=arc-20160816; b=YPZXzGfBAurKW207oG0KqqILyD1jmvSvz/77d7b9aTz+xN2cezrIOKOgEuA74Hhw9q ObUFjftWj3nNYozP2fpNznRClojm/9ajweQMbVTVXFG6E6Ij+SGgJEAv11dZ8+sIrSpU iMKPq/tPe7O/Ea86J3tbbDLW78lP0PUPy13LN446/rlvaYjh4a06oTvtAmuRnYWwXtqh 8YtsuPutEXPf5ytUzRuMm6Sy/EaPwxdjEM1PkHGpdmbLCVG6OsbCfwzsTxIISt2Lj7Lj s01sx9oMze2PoFCRioUFzOc/05t2Em4OXIqWmdGgvIVTs4n+s4AbTQ0wxIATr8Te4yQu 0gCw== 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=Ugy9HzygJj9cXld5gfxImtfW2S/sgx4iZNX3niDic4Q=; b=eKRsEup0B7K/o61E8+7P1lC84VsuxahtB2Y/JYNc7PaIViiUyvDVKtS87BTg5Zp4Q1 ebn48fAok23jfjZ8+OS56+GFvTmA8SoQm9NG+CGplLq5SmiT6keVl8Cg70gqe+HlJ9hA kFrPe13hqDVcji5HzEd+XIJqWJyvQa5ZJycrwdvlK/wKqTliLqV1d+BpZMoZsdd/dCT4 httj9YJ/+tfuhbdPP7Q17+X1dYFU7NXn+D/Lm969VhVimhf5TkO+M20uAaZtFXFotSW4 7j6AQJ+GhJvtGuCJYAJhnYxvVYKj5KbLoEUtOAqLTk5HyMjiEcXi4IpYq5cUHZX/do1l lxJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xf3V/jkV"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a637442000000b0045b00922ba5si1364651pgn.871.2022.11.10.21.32.25; Thu, 10 Nov 2022 21:32:37 -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=@kernel.org header.s=k20201202 header.b="Xf3V/jkV"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232125AbiKKFRk (ORCPT + 92 others); Fri, 11 Nov 2022 00:17:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiKKFRc (ORCPT ); Fri, 11 Nov 2022 00:17:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA26E6B383; Thu, 10 Nov 2022 21:17:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A0CDDB81E60; Fri, 11 Nov 2022 05:17:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BC44C433C1; Fri, 11 Nov 2022 05:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668143849; bh=n+aNotBQFKuFcOYsREI/VGTiSdZhVRAVtpMX5N+QlU0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xf3V/jkVqHQegrpSr0Xg4J7SVOGlmG0XblfaVvPyDP45FLlyTZlCRO4vCl4QWZzcc KKkXVtDO8r9wBZIAoHXZiN9YxB9mJu5l6bQyAZcirrnsx6zfZ+j3CvlqW06ByoC/kJ meBkKTi41p+cihQnTdk+LqnIXY74RpXEQLORj15YvivVG9y89svujZS8WVbZcK1BmM 2HC1GJTgRINZEq11uLJHAfPUfTSA2/t9Keyy4LXBr22uSnfqwCsC62kzhUyAtMQUat WnkumBt55C1euGOi9hGaXrmzF0h2Uw3Hd8AQSA+Y9X9v9njwJeZYWGUQCOHNu2RKMB EM7JFrWdlq3Qw== Date: Fri, 11 Nov 2022 13:17:21 +0800 From: Shawn Guo To: Francesco Dolcini Cc: Alexander Stein , Philippe Schenker , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Fabio Estevam , Krzysztof Kozlowski , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , linux-kernel@vger.kernel.org, Philippe Schenker Subject: Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching Message-ID: <20221111051721.GD2649582@dragon> References: <20221102155226.51587-1-dev@pschenker.ch> <4964263.31r3eYUQgx@steina-w> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, Nov 03, 2022 at 09:04:53AM +0100, Francesco Dolcini wrote: > On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote: > > Hi Philippe, > > > > Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe Schenker: > > > From: Philippe Schenker > > > > > > The Colibri standard provides a GPIO called USBC_DET to switch from > > > USB Host to USB Device and back. The Colibri iMX6ULL does have the SoC > > > ball USB_OTG1_VBUS connected in series with a capacitor to ground. > > > > > > This means that we need to provide to the extcon framework VBUS and ID > > > events using the single GPIO we have. The Extcon USB GPIO driver does > > > use id-gpio also for VBUS event, as in our case where vbus-gpio is > > > absent. > > > > > > Signed-off-by: Philippe Schenker > > > > > > --- > > > > > > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > > > > > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi > > > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index 577a424b0e1d..feb1fcd9a684 > > > 100644 > > > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi > > > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi > > > @@ -24,6 +24,13 @@ backlight: backlight { > > > status = "okay"; > > > }; > > > > > > + extcon_usbc_det: usbc-det { > > > + compatible = "linux,extcon-usb-gpio"; > > > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / > > USBC_DET */ > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_snvs_usbc_det>; > > > + }; > > > + > > > gpio-keys { > > > compatible = "gpio-keys"; > > > pinctrl-names = "default"; > > > @@ -275,6 +282,7 @@ &uart5 { > > > /* Colibri USBC */ > > > &usbotg1 { > > > dr_mode = "otg"; > > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>; > > > > How came you up with this double entries? Is there some documentation you need > > two phandles? > > extcon-usb-gpio provides both vbus/otg_id with a single handle, however > the integration in chipidea is somehow weird, the first entry is supposed to be > used to read the vbus, the second one to read the otg_id. > > So if you need to read both you really need to have the handle twice ... Thanks for the input, Francesco! Philippe, Do you consider to use usb-role-switch as suggested by Alexander, considering the weirdness of how chipidea driver supports extcon-usb-gpio? Shawn