From patchwork Thu May 4 13:46:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 13231257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2006C7EE29 for ; Thu, 4 May 2023 13:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qcmyywpe4kLqA5vdisu7Pq5UQE7w+6GHeUXengA9H0w=; b=W+jeGvVuDEqGwk xKvrPMGHgKOzyXtOB5CuJnTdVs60MwC/p9Ff02RXQ4t/A73l0Pc2JpHGyHPsW3IndDqxaSbRr0+3l ki2o79aGSJSHR2RoB4WRRejVN/XjN5AtxPY9x6GkUchfbSXzyGMGkcuAwBpCk/050trxf2Fn1jGx3 bm+lqYVsD658WsXmRolKbMg+WEdG+O5VTqhO4m7LN+HcC7bCkUwQFCanc+i2NZ9ayrnLP/I3MBXPf utrX1Obl9HBRV78usQ17jZw60DjB0+Y7f2k2yJSC3PeJGPjW6BR7PnR3tHKvvI3vAp0J1YjFDiVac gfELhYlQ56ob0EJReRlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1puZJ7-007zwE-0j; Thu, 04 May 2023 13:47:41 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1puZJ1-007zu3-0b for linux-arm-kernel@lists.infradead.org; Thu, 04 May 2023 13:47:36 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1puZIU-0004SX-82; Thu, 04 May 2023 15:47:02 +0200 From: Marco Felsch Date: Thu, 04 May 2023 15:46:50 +0200 Subject: [PATCH v2 1/4] dt-bindings: usb: gpio-sbu-mux: add support for ss-data lanes mux MIME-Version: 1.0 Message-Id: <20230504-b4-v6-3-topic-boards-imx8mp-evk-dual-role-usb-v2-1-3889b1b2050c@pengutronix.de> References: <20230504-b4-v6-3-topic-boards-imx8mp-evk-dual-role-usb-v2-0-3889b1b2050c@pengutronix.de> In-Reply-To: <20230504-b4-v6-3-topic-boards-imx8mp-evk-dual-role-usb-v2-0-3889b1b2050c@pengutronix.de> To: andreas@fatal.se, jun.li@nxp.com, Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Heikki Krogerus , Guenter Roeck , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marco Felsch X-Mailer: b4 0.12.1 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230504_064735_230543_3FB4C7FE X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds the support for GPIO based USB-C SS data lane muxing. Signed-off-by: Marco Felsch --- .../devicetree/bindings/usb/gpio-sbu-mux.yaml | 82 +++++++++++++++++++--- 1 file changed, 71 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml index bf4b1d016e1f..796f3283ac02 100644 --- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml @@ -4,24 +4,26 @@ $id: "http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml#" $schema: "http://devicetree.org/meta-schemas/core.yaml#" -title: GPIO-based SBU mux +title: GPIO-based SS/SBU mux maintainers: - Bjorn Andersson description: - In USB Type-C applications the SBU lines needs to be connected, disconnected - and swapped depending on the altmode and orientation. This binding describes - a family of hardware solutions which switches between these modes using GPIO - signals. + In USB Type-C applications the SS/SBU lines needs to be connected, + disconnected and swapped depending on the altmode and orientation. This + binding describes a family of hardware solutions which switches between these + modes using GPIO signals. properties: compatible: - items: - - enum: - - onnn,fsusb43l10x - - pericom,pi3usb102 - - const: gpio-sbu-mux + oneOf: + - items: + - enum: + - onnn,fsusb43l10x + - pericom,pi3usb102 + - const: gpio-sbu-mux + - const: gpio-ss-mux enable-gpios: description: Switch enable GPIO @@ -50,10 +52,18 @@ required: - compatible - enable-gpios - select-gpios - - mode-switch - orientation-switch - port +if: + properties: + compatible: + contains: + const: gpio-sbu-mux +then: + required: + - mode-switch + additionalProperties: false examples: @@ -107,4 +117,54 @@ examples: }; }; }; + + - | + #include + + tcpm { + connector { + compatible = "usb-c-connector"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + tcpm_hs_out: endpoint { + remote-endpoint = <&usb_hs_phy_in>; + }; + }; + + port@1 { + reg = <1>; + tcpm_ss_out: endpoint { + remote-endpoint = <&usb_ss_phy_in>; + }; + }; + + port@2 { + reg = <2>; + tcpm_ss_mux_out: endpoint { + remote-endpoint = <&ss_mux_in>; + }; + }; + }; + }; + }; + + usb-ss-mux { + compatible = "gpio-ss-mux"; + + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; + + orientation-switch; + + port { + ss_mux_in: endpoint { + remote-endpoint = <&tcpm_ss_mux_out>; + }; + }; + }; ...