Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp847775iog; Mon, 13 Jun 2022 14:23:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s3UCNAIyVkY8tsH6Ib7PCo2c9aaZgGoDKGf9ZJuoklS7q+WhoMNQKtkIS8Q/s/ZbBCz18o X-Received: by 2002:a17:907:1c97:b0:6f5:22ae:7024 with SMTP id nb23-20020a1709071c9700b006f522ae7024mr1528926ejc.570.1655155427664; Mon, 13 Jun 2022 14:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655155427; cv=none; d=google.com; s=arc-20160816; b=hryu7m0kHl+bM91RujtILBpbELw6vadkasLNhykWz40UiL5BGKna9V62ZZvtB4qx+r 9d+QyRd9PvvQumxvgW7nc2GKNe6SC8uxFRgF1HL7rJcNF/3IIL6+wdWOF4Y6VdzWNgik las2jFJavXz3okAKXuZKL46DbRRJHl/pXjF9bOcEb/AwoIXXzAZDv+uK+Hxkm+mnwLHs Br8AVxwnoudtN/fS5qj2bzL/neA729N+Jbc38u7nPmdA8HzWc6zkEmFRoKleozA7Kymz sj6FQUFQ/iN2PMTLR5KN26EL78sokZMO3n7ko3YVcysVkEhKkUpgULE9jbSbLJbLiV+x E6Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=m5JCegGAYMi5Q9W2JQGuLDIcqo00Awy4QAwQXlwcWcE=; b=SAOLrGn82DvBgoGtwFKSYMoGAcoVa+Nfm2KSwuizOxQOBvDMERAGNmTCqA+wWxP4ZF JcEhlX6n/Wqjzt+9IiPthSV8mIUStS4tfFhlbDWuhTUB+S6mR6+PNkdpaei4nWtr3y18 GAEtsvfyzkiLfn0NOv77Ob4CPb2SuS1cQLC4+gaBKbdJ+osZyQ8HGagRc1J9HWAzSqZe ulHMHf4BzAbIadWb206WxeCgKcgC/jELlv7iU4t+v2BETELZp3TuYNA9XtW+GSe6nW7H cyU+hD+kchYG+VkpJ6v0+D6YVxkRxfNJaof1W6woG3SdP9xcL7S2+KkUvNIcYuHkOhmF y7/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y8PgXmY2; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a17090651cc00b00718d0b634e0si1917241ejk.660.2022.06.13.14.23.22; Mon, 13 Jun 2022 14:23:47 -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=@chromium.org header.s=google header.b=Y8PgXmY2; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348466AbiFMVID (ORCPT + 99 others); Mon, 13 Jun 2022 17:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351672AbiFMVHC (ORCPT ); Mon, 13 Jun 2022 17:07:02 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C81DEB6 for ; Mon, 13 Jun 2022 13:45:06 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id u99so11791984ybi.11 for ; Mon, 13 Jun 2022 13:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=m5JCegGAYMi5Q9W2JQGuLDIcqo00Awy4QAwQXlwcWcE=; b=Y8PgXmY2/nGutxvyX2dVqsPiD/5+ONTAVCrb5dCOijLp6hOh6guiH0qrM/AiFzGG+L 2zF2AhQ2OrJIp07OjeQZkImtrzevfAiZn6aQPFYk7tefYh8Atc6pUh3dMEF2rocc9zmP Dg3xzw03JF6KBjd+jSOcSvmgwkw8LZeAS0/XQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=m5JCegGAYMi5Q9W2JQGuLDIcqo00Awy4QAwQXlwcWcE=; b=1CKtug75wKRsVubdnMDTlNQoQycOb5p6jx3XLXkCTGiSEl0UVM2OgfBsUjZHRVXlzq Et85Z2fMS0Hh0gVnKGkghCzbAv6RgykvS6O+UkYFu0tLMoOHXMXLytC8fPTwBklQ0QSq mOTaAuWXOZzFS45ANJ/cqT5BVfHQsoD+rjpBsd0eoflbJCXo2HfZdqs/gfqOrifVZS1p KHEmB9d5lxHX9chEXtNAVeoOt7MdCjB6G+w1yPtpQtsvHKkcNUnLipjF62oZNydOnzJa GHO2iB6kku6uYGyUWH3au3XTJ2BNTk5vgn5EME879M/i7kpCWNDOB73uhYd6oLgf/4Md xmRQ== X-Gm-Message-State: AJIora8NadFrzpw2f+VkXNhBwJTvCn7LkUUbwO/vUPIMUZf/WmI4ejsD EQ5Juzwt0zEXnFhs3RyTtoxW/dDGKERkbq1zy1Q52g== X-Received: by 2002:a25:ce83:0:b0:664:6360:41ae with SMTP id x125-20020a25ce83000000b00664636041aemr1514280ybe.336.1655153105879; Mon, 13 Jun 2022 13:45:05 -0700 (PDT) MIME-Version: 1.0 References: <20220609181106.3695103-1-pmalani@chromium.org> <20220609181106.3695103-4-pmalani@chromium.org> <20220613203804.3d23gxidkw657ggq@notapiano> In-Reply-To: <20220613203804.3d23gxidkw657ggq@notapiano> From: Prashant Malani Date: Mon, 13 Jun 2022 13:44:54 -0700 Message-ID: Subject: Re: [PATCH v2 3/7] dt-bindings: usb: Add Type-C switch binding To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, bleung@chromium.org, swboyd@chromium.org, heikki.krogerus@linux.intel.com, Andrzej Hajda , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:DRM DRIVERS" , Greg Kroah-Hartman , Hsin-Yi Wang , Jernej Skrabec , Jonas Karlman , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= , Krzysztof Kozlowski , Laurent Pinchart , Maxime Ripard , Neil Armstrong , Pin-Yen Lin , Robert Foss , Rob Herring , Sam Ravnborg , Thomas Zimmermann , Tzung-Bi Shih , Xin Ji Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Hi N=C3=ADcolas, On Mon, Jun 13, 2022 at 1:38 PM N=C3=ADcolas F. R. A. Prado wrote: > > Hi Prashant, > > thanks for the patch. Please see sugestions below. > > On Thu, Jun 09, 2022 at 06:09:42PM +0000, Prashant Malani wrote: > > Introduce a binding which represents a component that can control the > > routing of USB Type-C data lines as well as address data line > > orientation (based on CC lines' orientation). > > > > Signed-off-by: Prashant Malani > > --- > > > > Changes since v1: > > - Removed "items" from compatible. > > - Fixed indentation in example. > > > > .../devicetree/bindings/usb/typec-switch.yaml | 74 +++++++++++++++++++ > > 1 file changed, 74 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/usb/typec-switch.= yaml > > > > diff --git a/Documentation/devicetree/bindings/usb/typec-switch.yaml b/= Documentation/devicetree/bindings/usb/typec-switch.yaml > > new file mode 100644 > > index 000000000000..78b0190c8543 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/usb/typec-switch.yaml > > @@ -0,0 +1,74 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/usb/typec-switch.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: USB Type-C Switch > > + > > +maintainers: > > + - Prashant Malani > > + > > +description: > > + A USB Type-C switch represents a component which routes USB Type-C d= ata > > + lines to various protocol host controllers (e.g USB, VESA DisplayPor= t, > > + Thunderbolt etc.) depending on which mode the Type-C port, port part= ner > > + and cable are operating in. It can also modify lane routing based on > > + the orientation of a connected Type-C peripheral. > > + > > +properties: > > + compatible: > > + const: typec-switch > > + > > + mode-switch: > > + type: boolean > > + description: Specify that this switch can handle alternate mode sw= itching. > > + > > + orientation-switch: > > + type: boolean > > + description: Specify that this switch can handle orientation switc= hing. > > + > > + ports: > > + $ref: /schemas/graph.yaml#/properties/ports > > + description: OF graph binding modelling data lines to the Type-C s= witch. > > + > > + properties: > > + port@0: > > + $ref: /schemas/graph.yaml#/properties/port > > + description: Link between the switch and a Type-C connector. > > Since you have a single port, you can omit the ports node. I've kept "ports", since it should be possible to add additional ports which connect the switch to some other entity (and kept separate from port@0), if the individual driver desires this. port@0 should only contain the end-point from the Type-C connector. > > > + > > + required: > > + - port@0 > > + > > +required: > > + - compatible > > + - ports > > + > > +anyOf: > > + - required: > > + - mode-switch > > + - required: > > + - orientation-switch > > + > > +additionalProperties: true > > + > > +examples: > > + - | > > + drm-bridge { > > + usb-switch { > > + compatible =3D "typec-switch"; > > + mode-switch; > > + orientation-switch; > > + ports { > > + #address-cells =3D <1>; > > + #size-cells =3D <0>; > > + > > + port@0 { > > + reg =3D <0>; > > + anx_ep: endpoint { > > + remote-endpoint =3D <&typec_controller>; > > + }; > > + }; > > + }; > > So instead of ports you would have just > > port { > anx_ep: endpoint { > remote-endpoint =3D <&typec_controller>; > }; > }; > > And the same simplification on patch 4, for the anx7625 dt-binding. > > Thanks, > N=C3=ADcolas > > > + }; > > + }; > > -- > > 2.36.1.476.g0c4daa206d-goog > >