Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6164885iog; Thu, 23 Jun 2022 12:43:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v4zMs0fZ60ohPdJ/LH4IoubsOwyDwdR+J4XjKyxqKlfzRVJLiq4XQZorARonTS04sScLYz X-Received: by 2002:a17:906:4fd6:b0:70c:9284:cc01 with SMTP id i22-20020a1709064fd600b0070c9284cc01mr10078030ejw.553.1656013387098; Thu, 23 Jun 2022 12:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656013387; cv=none; d=google.com; s=arc-20160816; b=f0jd4oR0i2GLTi+JtTn1uw9DXlaTTZsex4tEldqFT9EVj2oojeWeZVwAybFPBc1yk6 8ARK2AF6DkVwibH4nJjnCYEkgDsInUhvFwOmfjWzDKzn0OQUV7qrAKyagayp+KF30dks U538eR6U4HY6uyclu1hUmIWVQ2+Hz4LM2pGpPOLLYAqKZZtq3MHbKj/Uo7PAKs0XEvUK plOBC5MlxZK9aJnhvceAueMaqd9jI3RvVf+9jRkyRuf3RFlqDVvMsf65c9diCreyg2Uc MLdlmK/sAoxbSXOPOnMx7lADzso277KZqbhotV+bsmgkISwS3Zu5BL4r3zRSnqlWeSc+ qEkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cI9+Tt7Z23d5RLVvZyen7R3tMKAwKXD+mtIbHKBAs/0=; b=PRD9UpxdiBsr2xxrafKSM9T/GHXJlQnQQK35NW+68ZxdD5OpaMH7892r2ABFuzXTFM /np2m0Rh50dZUOEFWgIw+Y1OSbZToflmM/u5LXhQsEB5NRslX64pYkTM6L8yMlUdKJQo 5fLoJDQx8YmkITiU5PFyKiG1/YsWlQRCEQx9o9byKhVaKG75jqH9RKaAP6jL9unG8Sed RwZABnwVUkq0T6ns8s9R7I7szfQkgqsgFLeqIk9fKoE93ujZ2+8peHXm2wLPEsUui7Md vQL8GApvOU8bgEyMvE1jPHQZfkEpY91Z9HL/Ae7BgciYE8J8cfzi+mderLWQ8Odlrj2V sG0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EwRTeyOD; 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 hq18-20020a1709073f1200b007117f5643e4si1942860ejc.944.2022.06.23.12.42.41; Thu, 23 Jun 2022 12:43:07 -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=EwRTeyOD; 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 S229965AbiFWTec (ORCPT + 99 others); Thu, 23 Jun 2022 15:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbiFWTcT (ORCPT ); Thu, 23 Jun 2022 15:32:19 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0BBA3EF37 for ; Thu, 23 Jun 2022 12:08:32 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-317741c86fdso3928527b3.2 for ; Thu, 23 Jun 2022 12:08:32 -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; bh=cI9+Tt7Z23d5RLVvZyen7R3tMKAwKXD+mtIbHKBAs/0=; b=EwRTeyODFUti7GZ+xjLiRABaUIFE+v7VX2QUxT1gLoLb7OcrDvTuc6YmjFeBi4QPK8 cMcrZYL/sB3CiRaYHBqxYeHyYY9+3MMopZKUBg8OgBIT5gj7y2fBBjARSaMRIu9EVLOi /mclFnDn/0H+0h2tsaiH5pZNuBZIw6OokDWIE= 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; bh=cI9+Tt7Z23d5RLVvZyen7R3tMKAwKXD+mtIbHKBAs/0=; b=xtMX5ibvwwyV/3GFWlRVvFqiLwTw4JxkPrz0B/9guoZDPJNl1tW4fBhtT3c/zDqNsk SaCmW2XTcILt+lXD14HTH3sjE6Z/3TdLFn8uicvlbanDoSUxBDIzZ2Ovg7GMAHMRQK/M sYWFu3vYgr453BRJoU4Pw72H6Q2+5cfF5hqI9KYcQxaRLb/3ovj7DreY6BaqxcHjrO4f OEtbW3GXF9QTAEvC7vUYWaOgpoHhWVEg+49z0otzZWwaYFbqJXz2tVkOgMGEvKpAtzaF GZnossbu0WoHnm6NyXWaQyZzXsf3nm8RZdgkACatsTFARsfYjalKoCXuKIEQqUAc1TAY FOpw== X-Gm-Message-State: AJIora+ImzpmXc4aGaBVkKWrJrBzydGopvQ47N1MJiGkUOhYDnthn/yT vSEHwzpowULxpbbiXkYD8iRFfena+yFQSlZDDTsDrQ== X-Received: by 2002:a0d:f045:0:b0:317:e6b2:2c64 with SMTP id z66-20020a0df045000000b00317e6b22c64mr12234518ywe.350.1656011311909; Thu, 23 Jun 2022 12:08:31 -0700 (PDT) MIME-Version: 1.0 References: <20220622173605.1168416-1-pmalani@chromium.org> <20220622173605.1168416-2-pmalani@chromium.org> In-Reply-To: From: Prashant Malani Date: Thu, 23 Jun 2022 12:08:21 -0700 Message-ID: Subject: Re: [PATCH v5 1/9] dt-bindings: usb: Add Type-C switch binding To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, bleung@chromium.org, heikki.krogerus@linux.intel.com, Krzysztof Kozlowski , AngeloGioacchino Del Regno , =?UTF-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , Allen Chen , Andrzej Hajda , Daniel Vetter , David Airlie , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, 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 , Xin Ji Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 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 On Thu, Jun 23, 2022 at 11:30 AM Stephen Boyd wrote: > > Quoting Prashant Malani (2022-06-22 10:34:30) > > 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 data > > + lines to various protocol host controllers (e.g USB, VESA DisplayPort, > > + Thunderbolt etc.) depending on which mode the Type-C port, port partner > > + 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 switching. > > + > > + orientation-switch: > > + type: boolean > > + description: Specify that this switch can handle orientation switching. > > + > > + ports: > > + $ref: /schemas/graph.yaml#/properties/ports > > + description: OF graph binding modelling data lines to the Type-C switch. > > + > > + properties: > > + port@0: > > + $ref: /schemas/graph.yaml#/properties/port > > + description: Link between the switch and a Type-C connector. > > Is there an update to the usb-c-connector binding to accept this port > connection? Not at this time. I don't think we should enforce that either. (Type-C data-lines could theoretically be routed through intermediate hardware like retimers/repeaters) > > > + > > + required: > > + - port@0 > > + > > +required: > > + - compatible > > + - ports > > + > > +anyOf: > > + - required: > > + - mode-switch > > + - required: > > + - orientation-switch > > + > > +additionalProperties: true > > + > > +examples: > > + - | > > + drm-bridge { > > + usb-switch { > > + compatible = "typec-switch"; > > I still don't understand the subnode design here. usb-switch as a > container node indicates to me that this is a bus, but in earlier rounds > of this series it was stated this isn't a bus. I am not aware of this as a requirement. Can you please point me to the documentation that states this needs to be the case? > Why doesn't it work to > merge everything inside usb-switch directly into the drm-bridge node? I attempted to explain the rationale in the previous version [1], but using a dedicated sub-node means the driver doesn't haven't to inspect individual ports to determine which of them need switches registered for them. If it sees a `typec-switch`, it registers a mode-switch and/or orientation-switch. IMO it simplifies the hardware device binding too. It also maps with the internal block diagram for these hardware components (for ex. the anx7625 crosspoint switch is a separate sub-block within anx7625). [1] https://lore.kernel.org/linux-usb/CACeCKaeH6qTTdG_huC4yw0xxG8TYEOtfPW3tiVNwYs=P4QVPXg@mail.gmail.com/ > > > + mode-switch; > > + orientation-switch; > > + ports { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + port@0 { > > + reg = <0>; > > + anx_ep: endpoint { > > + remote-endpoint = <&typec_controller>; > > + }; > > + }; > > + }; > > + };