From patchwork Wed Nov 2 15:52:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Schenker X-Patchwork-Id: 14311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ee07:0:0:0:0:0 with SMTP id y7csp18044wrn; Wed, 2 Nov 2022 08:53:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Ya7J76RlzYVce0iceRqceFE7TYr8dBSKZueHGeDF/dD8ICZp/DMTmBEsZgj9mRdlNWz4O X-Received: by 2002:a05:6a00:13aa:b0:56b:c782:107f with SMTP id t42-20020a056a0013aa00b0056bc782107fmr25459619pfg.43.1667404418960; Wed, 02 Nov 2022 08:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667404418; cv=none; d=google.com; s=arc-20160816; b=WHYZ2cE2WbyhzX+RHZoYugh/0D+mbcM+rrz4UvYwu1DGSJ5/mr5x+Cs/S3iLq7T25a /XR6QSxGpmL2ure/Gd/VV2PxTMDq2s6CxSLBwYESU05dVMp9wPg0HAYl5it+Jo1Mo2Gc FUG4Ot0CgJH3eNJfANu8y70pNCdti5p473d/dGsiNwed42rg6pw5BI0wtDk7Qmdnn5GJ zmRyozto7eFZStSf1NP9KaZfs8mrtb6+3NTQSpIXSSsXkrYaFfMP92avLRSEqcffeZpH uilHcWXhnqao/WvwZgJtoqcW/+ByEb6UhFgyaFHl/hDt17fYswozUhY7L7uXksfy1Ojb rDag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7RAJSVbnPaockqds5kr1cdmh1ys2f76FTq9CJvS8rHg=; b=FdsSbK4s+YwnUL13qIfUwNEUEF/YYaKGqHSfvSN0kiPQLvO40JyaaFBOFnkv7n+w3N WnPWJae/CeFo7/nOtXwzoCpdTTSxEfGLc1If1ehQdFh9lNp+nrQngrYfbsSMbxVYOHIM wfKII7XrmqipVn47J8moNUQvwl14T/AO6WkZvF+TT3OFaxj8SUv1KXyJh95o9adcYPAh bV9t6bI699iP7VJtzk15eC2fQ396KNuUExXF3PgursJ5CdPmGFzHN+B0K7v9q3LRXFga Bmyo0TWC5VN/ZAMUr6m3NDHqxlU2solnEBFfG0Rdk8Ae5VkN/MX4SXt4uS6PQ9wcyipN e7UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pschenker.ch header.s=20220412 header.b=TQm8+MuV; 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=pschenker.ch Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b00453d2790c49si16819130pgd.11.2022.11.02.08.53.25; Wed, 02 Nov 2022 08:53:38 -0700 (PDT) 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=@pschenker.ch header.s=20220412 header.b=TQm8+MuV; 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=pschenker.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbiKBPwj (ORCPT + 99 others); Wed, 2 Nov 2022 11:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbiKBPwi (ORCPT ); Wed, 2 Nov 2022 11:52:38 -0400 Received: from smtp-bc09.mail.infomaniak.ch (smtp-bc09.mail.infomaniak.ch [IPv6:2001:1600:3:17::bc09]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A2C2AE35 for ; Wed, 2 Nov 2022 08:52:35 -0700 (PDT) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4N2WcK0L8xzMqNZt; Wed, 2 Nov 2022 16:52:33 +0100 (CET) Received: from philippe-pc.toradex.int (unknown [31.10.206.125]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4N2WcJ40DVzMpqBV; Wed, 2 Nov 2022 16:52:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pschenker.ch; s=20220412; t=1667404352; bh=hsmqP6LW9Hc8mmhziJ3amvKnlktfxLKv2Sastr0h7Mc=; h=From:To:Cc:Subject:Date:From; b=TQm8+MuVUwOG0FZujEOnW7Guwm64m8a1xGcEzqlHvLxisaRwxJuzqvTua50ZFeZ+X WaTLDPNoYxMGvittPp5RHg9Qxp6YowAa+4AbXgQ0O7bT+VF+dU5UR0okp58kB1PKra k1IgbmLnWIgyikD4GOCunTDajWVD1JyWv9QxjEUk= From: Philippe Schenker To: Shawn Guo , devicetree@vger.kernel.org Cc: Philippe Schenker , Fabio Estevam , Krzysztof Kozlowski , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching Date: Wed, 2 Nov 2022 16:52:26 +0100 Message-Id: <20221102155226.51587-1-dev@pschenker.ch> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748400256113741904?= X-GMAIL-MSGID: =?utf-8?q?1748400256113741904?= 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>; srp-disable; hnp-disable; adp-disable;