Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp622170imw; Wed, 13 Jul 2022 05:10:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unrNbv5soSV/Qnjy6v1thmqKZlRCSkk9ov82+TGCqeQDJhonazoihrF9nEbIb4bsU6bLe9 X-Received: by 2002:a17:903:26c1:b0:16b:df40:e566 with SMTP id jg1-20020a17090326c100b0016bdf40e566mr2880689plb.121.1657714225991; Wed, 13 Jul 2022 05:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657714225; cv=none; d=google.com; s=arc-20160816; b=Q2r+rHjZQSKmLmLpq7Rsuxz2xVmTgLl0yKToDm4LrqzqjeK54p2b+7qVkHfI+gOb4D La5uC0M3yC5gstxp/QJHH0o7mrjiWtBHFA+aDNJl309cXUHffen35bS8EZZ1ppWUhoFy AnpfoDXnRs5RtPPZhvmBGDPJJCVUulR1/TClXrQyQAbJl/PNFLBZGisHwvry9Jk38ys2 heLd2DgSkKGd9wZoBM+tJfZhqdWBS+QjEwxJJxPwCu8EqLAE+85xqCZHs2j4y6KLvqjY ah0gdb6LGOnU8VE31eOceiqzjlG1kmbSb0X10qtZ9bmgMuPCwlwlbFcZlLLhscUBb/SD iFwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=03MrTYHz9E1RnPfUmzk5doRoqAFETO2nHzzN60QH1u8=; b=AJadKBiQ0yJfDu9xhWw/rWHhkdhVmKgzKdY6FsuUsJKCG5rFhAOE2aueWCLqTiIQgw qCE2OtGvRSB9GfX1ipPvG5sumagQSx8m7mlEeVe5pLs/r7GsxCESPUkskZhYmqHJaHSF yuolc+E7DZ1FIwsXKfz6iKpw5Yma3XKn/lVEFRhqit0ZTqtkkPHoW6i3nX3igjqmT+O8 QOmVqtk1Mnc/Ysrs/ecl0469gEF8Wx/VbC7VLP1OAFBDTfdu9XwuAQ3tPu1ZcUz/B5bk 7T+iLuPM4Ma8h4x9NeR1gPmc8b5jHGiT5a0QBSnpwGHV5AMk5Iyw61MuEv8Dp7C4eCoW kHYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=F2wbiBc0; 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=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170902e74800b0016c44b7c8c5si13668560plf.11.2022.07.13.05.10.06; Wed, 13 Jul 2022 05:10:25 -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=@foss.st.com header.s=selector1 header.b=F2wbiBc0; 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=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236329AbiGMMJS (ORCPT + 99 others); Wed, 13 Jul 2022 08:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236348AbiGMMJP (ORCPT ); Wed, 13 Jul 2022 08:09:15 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63099A682; Wed, 13 Jul 2022 05:09:14 -0700 (PDT) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26DAL7Uw002441; Wed, 13 Jul 2022 14:09:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=03MrTYHz9E1RnPfUmzk5doRoqAFETO2nHzzN60QH1u8=; b=F2wbiBc051D8/pWpYHvGLyno8XUwlYtD552WOAH7N+DPo7eANom7K7WKcBq3e89LycQ7 oD9MH7sC58u1+TVi5akMFPXLkEpjBP6dIM950135vc0QE+W62lpiZbcmnqJVd1BXEYLH LheBGpJ6Wqd6HvFP5svKhEXAyad3xgynKxbCLaRK3bsXbhBt058vjPu+pPeN30ymxNDh dypW0Us5ZKPjG0SOy9ywI3VUKmSKZWlhfJVdKCXEfKQCv0xyb0u8kaBkSzhLQQQ4zoHb 4O2fdxp7xyMu7c5R4S/6tNnb0BEhLqgaeQWoXDsLehF2lQDTcB7k0jCt9RQ5ZuI3vML/ kA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3h9173su8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Jul 2022 14:09:03 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B8CF110002A; Wed, 13 Jul 2022 14:09:02 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id AF05E21ED52; Wed, 13 Jul 2022 14:09:02 +0200 (CEST) Received: from localhost (10.75.127.47) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Wed, 13 Jul 2022 14:09:02 +0200 From: Fabrice Gasnier To: , , , CC: , , , , , , , Subject: [PATCH v3 1/3] dt-bindings: usb: typec: add bindings for stm32g0 controller Date: Wed, 13 Jul 2022 14:08:40 +0200 Message-ID: <20220713120842.560902-2-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713120842.560902-1-fabrice.gasnier@foss.st.com> References: <20220713120842.560902-1-fabrice.gasnier@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-12_14,2022-07-13_02,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Add DT schema documentation for the STM32G0 Type-C PD (Power Delivery) controller. STM32G0 provides an integrated USB Type-C and power delivery interface. It can be programmed with a firmware to handle UCSI protocol over I2C interface. A GPIO is used as an interrupt line. It may be used as a wakeup source, so use optional "wakeup-source" and "power-domains" properties to support wakeup. The firmware itself may be flashed or later updated (optional). Choice is let to the application to allow firmware update. A default firmware could be already programmed in production and be customized (to not allow it). So the firmware-name is made optional to represent this option. Signed-off-by: Fabrice Gasnier --- Changes in v3: - Add connector to the required properties as pointed out by Krzysztof. Update commit message to explain why the firmware-name is optional. Changes in v2: - Krzysztof's review comments: update commit message, use ports, use unevaluatedProperties: false for usb-connector schema, define maxItems for power-domains, adopt generic node names, remove quotes --- .../bindings/usb/st,typec-stm32g0.yaml | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml diff --git a/Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml b/Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml new file mode 100644 index 0000000000000..1cb68cabe17df --- /dev/null +++ b/Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml @@ -0,0 +1,91 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/st,typec-stm32g0.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32G0 USB Type-C PD controller + +description: | + The STM32G0 MCU can be programmed to control Type-C connector(s) through I2C + typically using the UCSI protocol over I2C, with a dedicated alert + (interrupt) pin. + +maintainers: + - Fabrice Gasnier + +properties: + compatible: + const: st,stm32g0-typec + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + connector: + type: object + $ref: /schemas/connector/usb-connector.yaml# + unevaluatedProperties: false + + firmware-name: + description: | + Should contain the name of the default firmware image + file located on the firmware search path + + wakeup-source: true + + power-domains: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - connector + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + typec@53 { + compatible = "st,stm32g0-typec"; + reg = <0x53>; + /* Alert pin on GPIO PE12 */ + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpioe>; + + /* Example with one type-C connector */ + connector { + compatible = "usb-c-connector"; + label = "USB-C"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + con_usb_c_ep: endpoint { + remote-endpoint = <&usb_ep>; + }; + }; + }; + }; + }; + }; + + usb { + usb-role-switch; + port { + usb_ep: endpoint { + remote-endpoint = <&con_usb_c_ep>; + }; + }; + }; +... -- 2.25.1