From patchwork Tue Nov 15 18:05:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Schenker X-Patchwork-Id: 20497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2874881wru; Tue, 15 Nov 2022 10:15:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zttc+uE/v7SJogbbFzYUIlJ6lKV1yrlSUHetk4QYIYVVaXN1vuLz1IqDbf/qUyJjH/+g2 X-Received: by 2002:a05:6402:2b94:b0:467:9976:2e37 with SMTP id fj20-20020a0564022b9400b0046799762e37mr2566263edb.267.1668536127184; Tue, 15 Nov 2022 10:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668536127; cv=none; d=google.com; s=arc-20160816; b=G1kV0t4WimviFnXTu5tF3tvlYdQPgQEHt8PaDSfPiuVUdgpS3oAgY2rcLZrA9+VxM9 TKlonVwCCGYDW3BNBomufg9+tnWI7WIxxqeQDqd6AMmOuahg45GM8ov1Sq2pEjDM8wgi 1ol6Sg6Exw5ae4RPMwFUhSL+UsLY02nUXTohfC/SyF/Uy/HjdlPNmEqYBPqhzQebAcZA XSi8SXAtC7OX6ZREbPgMnQkff7O00mRaJZcDaPlL0jPSY6qrlE60BB5T667xXHCA2gGl e1hxPqnFklij5NK7lP/g0aL1qrjfxFWuNsesZ8c9tkdxVxYB+0bYSSJF36Jnf1yV0nYD 1HEw== 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=CpxQkYpetbbsPgnlvpK76XTEHWZvksvnFHGK0Pe7x6s=; b=XOxAjkhqWRUbOekap/c/0KLt6oOyOo0IKZ8RQ0eDaJL94CA3FicxTdQLPnWCwPUdgD 14Nal1u3L7XGi3wZfudTgJv/jK3V75qHIJyToYiIT2F6p4CrpBIpF5Wl9Rt+dkznE6x5 qXYK7ToqlgoSc77OJVuK+6BNrwxvjIKIuCoaDuVyOuj244fZAOef28gcZIyLZETbLUSC XUUoK3Tj5Sqo83aiBP/5wmmI/Ev1sWgPEYqrrzXlG6wX8fb7aZk51qSHCN9Kx+lV3eje O58S6FoQPbTp3jHSt+ze89pXxn9fyeR+/H16mL7fjFlQVKib2mRotNy3NfyUlEiJLfmu BE+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pschenker.ch header.s=20220412 header.b=lt1lC9fQ; 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 f22-20020a0564021e9600b004617bf36c3csi12674599edf.308.2022.11.15.10.15.02; Tue, 15 Nov 2022 10:15:27 -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=@pschenker.ch header.s=20220412 header.b=lt1lC9fQ; 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 S230425AbiKOSGg (ORCPT + 99 others); Tue, 15 Nov 2022 13:06:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiKOSGc (ORCPT ); Tue, 15 Nov 2022 13:06:32 -0500 Received: from smtp-bc0b.mail.infomaniak.ch (smtp-bc0b.mail.infomaniak.ch [IPv6:2001:1600:3:17::bc0b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382C2305 for ; Tue, 15 Nov 2022 10:06:30 -0800 (PST) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4NBYyn3rHZzMqFk9; Tue, 15 Nov 2022 19:06:25 +0100 (CET) Received: from philippe-pc.toradex.int (unknown [31.10.206.125]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4NBYyl11H9zMppYF; Tue, 15 Nov 2022 19:06:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pschenker.ch; s=20220412; t=1668535585; bh=Ppwbtaour3/Jw/cgaDOFjnjF7G+KdfGQVdagBHehM/g=; h=From:To:Cc:Subject:Date:From; b=lt1lC9fQVWKV5ufGh4LiBh1eGcYTsK9YSrmV7QZRKqi8erKNY1aWKxRmeQpd8P9AX PaOpnGoBFZ8w8PEAtP8UJMRpVZasp+s2sIaPmZFY21+v8tyhXFqUnmXqmA3yV/gJUe 8GmT1kNxgu/F494LF658bQB/L+IBwhXtuyLdcQS4= From: Philippe Schenker To: devicetree@vger.kernel.org, Shawn Guo Cc: Alexander Stein , 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 v2] ARM: dts: colibri-imx6ull: Enable dual-role switching Date: Tue, 15 Nov 2022 19:05:54 +0100 Message-Id: <20221115180554.73696-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?1749586938100880592?= X-GMAIL-MSGID: =?utf-8?q?1749586938100880592?= From: Philippe Schenker The Colibri standard provides a GPIO called USBC_DET to switch from USB Host to USB Device and back. Make use of this GPIO by adding it with usb-connector framework. Signed-off-by: Philippe Schenker --- Changes in v2: - Switched from extcon-usb-gpio to usb-connector-gpio arch/arm/boot/dts/imx6ull-colibri.dtsi | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi index a4429ba1f2ae..336ab2e0534c 100644 --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi @@ -24,6 +24,28 @@ backlight: backlight { status = "disabled"; }; + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_snvs_usbc_det>; + id-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */ + label = "USBC"; + self-powered; + type = "micro"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usb_dr_connector: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + }; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -280,6 +302,13 @@ &usbotg1 { srp-disable; hnp-disable; adp-disable; + usb-role-switch; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; }; /* Colibri USBH */