Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1198917iog; Thu, 16 Jun 2022 00:45:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vJusDTMD+M42Gjjeax9rld5VndpfT9iYykWNKYIKZjv+tO4c3LPP6QgtI4LAsIYIgGUk3B X-Received: by 2002:a17:907:7b85:b0:711:e42d:4955 with SMTP id ne5-20020a1709077b8500b00711e42d4955mr3320166ejc.482.1655365552041; Thu, 16 Jun 2022 00:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655365552; cv=none; d=google.com; s=arc-20160816; b=R6vaxsEmJJJ7BWtMz/B4Sg6MrJSaXm9Yds/HhRzsfGl2C7it4gAVp7ZPyvsHF8KKe+ wuLNuAyQSv1U24SlgYzn87PH/5k9E+RMUbF5NQ1EjETY4fMZsKzyXiLppSF47uC2mp44 NXl/QvD4eLt5c4oiV2u+Vn+i+3ZqTlRI/5km/ZcOzJMINDWIs+e2OTsmltGbheMykums B7BaZhM1S2qtYQxCJ9VuM0l6r4Aev+9u3gvcWw744sN0KcYv8K8CwmdCGXcym8H0iUsz 4n7XMjhiQtEOl86eAkSH+RKsGMc22LzwRRv9cILrCXkz2fU+hr7M6wnjG1F8hNRabvg3 Wu9Q== 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:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=K1qaur0XpbMxeFbDS5W87YOBUiUaAflQIADLDQn7Ujs=; b=Ijb/3wqNjFHQq0xC3Mx2H2WlIo8mf1aPdVR58lDuYuCV4+DJw1tvUEP0T62DLg7oey GBBVFERCf5dRdT/duAkLoMeqDPu4rNLOEQvPN0wC+SRkB7yGxKNAsGKGhhLy8uqNaeu5 RpxRlynHWjDdqhiWsZA7hHyp7I0eSqj1lkmFZDvQ2jCGU89lzQBBZdx2KKuL0syFjucN b9Vs0KFMmlaMgOlkRnxkrYuJD5206LkTaw2h/hf4ZFwD4gudIgAqV8BWyl07cnXHDFUe sc6v/06FxzU+bE2Uw5KZ3Rgs0GG7NZhWcUW8yQy7HhA0Fjf3U/p934sQc2i42kp1vc6V sL2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m8Gps9Ls; 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 p20-20020a170906839400b00711ce25e88esi928894ejx.427.2022.06.16.00.45.26; Thu, 16 Jun 2022 00:45:52 -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=m8Gps9Ls; 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 S1359417AbiFPHmF (ORCPT + 99 others); Thu, 16 Jun 2022 03:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359264AbiFPHmE (ORCPT ); Thu, 16 Jun 2022 03:42:04 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55535D1A5 for ; Thu, 16 Jun 2022 00:42:02 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id p8so957663oip.8 for ; Thu, 16 Jun 2022 00:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=K1qaur0XpbMxeFbDS5W87YOBUiUaAflQIADLDQn7Ujs=; b=m8Gps9LsbxAYdtCBGKNo2enla/9DKTViETZQMmsW8myE1vng5QgQ/gHEUDoqu8pINF j2znEdpDVeJjQTBmg7n+22gbjzHnPGB1tBxwont1Np8/Kmk1GuKWEEa3Af/ha8PXADZm iz95PcviZ/d4/dOo3iDtd3YbIXumoCuMr4XFI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=K1qaur0XpbMxeFbDS5W87YOBUiUaAflQIADLDQn7Ujs=; b=eUT4hm+6BuMJii3icx+PfMSUzyzBmhWvwqTvK62YLfItQSB6PwYwbQCCp7iNN+/2aG kjvw5yZhXKBQp/wJP69SWDuYLQoIrzyR/WXc3JDOjUcZUZDfoKg4+8pVJ1Hzk+QdhOy1 i6rAHxaNFmnnAGj1VsFRPekXFT4jRF2UEnUbdXvoh5tQIldy4vjkG+PG1ZSmZ0DwQQk8 izu5poJvgQMm3+MFTBXf3YiPHXQZMPmpxoH4KAUivyz9LVuNwUgY3iakbDHIit5er+TF TKp2r7o8u9u5n14Qi/A+evMLc7H/75W7cqQ30DvPGyCpEwyDm7EKvXTs9NK4rWQX1YKQ AMsg== X-Gm-Message-State: AJIora87bV2fp2NN97D1BKjiEifYUzO5P633g80yIeKiOQnP9YHmhBkp 3MR/wAbHEwKCDR+8kBgrzVnAVGa9AgJCJuw+LYmGvg== X-Received: by 2002:a05:6808:e87:b0:32e:4789:d2c with SMTP id k7-20020a0568080e8700b0032e47890d2cmr1789833oil.193.1655365322078; Thu, 16 Jun 2022 00:42:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 16 Jun 2022 00:42:01 -0700 MIME-Version: 1.0 In-Reply-To: <20220615172129.1314056-5-pmalani@chromium.org> References: <20220615172129.1314056-1-pmalani@chromium.org> <20220615172129.1314056-5-pmalani@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Thu, 16 Jun 2022 00:42:01 -0700 Message-ID: Subject: Re: [PATCH v4 4/7] dt-bindings: drm/bridge: anx7625: Add mode-switch support To: Prashant Malani , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: bleung@chromium.org, heikki.krogerus@linux.intel.com, =?UTF-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , 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=unavailable 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 Quoting Prashant Malani (2022-06-15 10:20:20) > > .../display/bridge/analogix,anx7625.yaml | 64 +++++++++++++++++++ > 1 file changed, 64 insertions(+) Can this file get a link to the product brief[1]? It helps to quickly find the block diagram. > > diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml > index 35a48515836e..bc6f7644db31 100644 > --- a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml > +++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml > @@ -105,6 +105,34 @@ properties: > - port@0 > - port@1 > > + switches: > + type: object > + description: Set of switches controlling DisplayPort traffic on > + outgoing RX/TX lanes to Type C ports. > + additionalProperties: false > + > + properties: > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + patternProperties: > + '^switch@[01]$': > + $ref: /schemas/usb/typec-switch.yaml# > + unevaluatedProperties: false > + > + properties: > + reg: > + maxItems: 1 > + > + required: > + - reg > + > + required: > + - switch@0 > + > required: > - compatible > - reg > @@ -167,5 +195,41 @@ examples: > }; > }; > }; > + switches { Is "switches" a bus? > + #address-cells = <1>; > + #size-cells = <0>; > + switch@0 { > + compatible = "typec-switch"; Is this compatible matched against a driver that's populated on this "switches" bus? > + reg = <0>; > + mode-switch; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + port@0 { > + reg = <0>; > + anx_typec0: endpoint { > + remote-endpoint = <&typec_port0>; > + }; > + }; > + }; I was expecting to see these simply be more ports in the existing graph binding of this device, and then have the 'mode-switch' or 'orientation-switch' properties be at the same level as the compatible string "analogix,anx7625". Here's the reasoning, based on looking at the product brief and the existing binding/implementation. Looking at the only existing implementation of this binding upstream in mt8183-kukui-jacuzzi.dtsi it looks like one of these typec ports is actually the same physically as the 'anx7625_out' endpoint (reg address of 1) that is already defined in the binding. It seems that MIPI DSI/DPI comes in and is output through 2 lanes, SSRX2 and SSTX2 according to the product brief[1], and that is connected to some eDP panel ("auo,b116xw03"). Presumably that is the same as anx_typec1 in this patch? I suspect the USB3.1 input is not connected on this board, and thus the crosspoint switch is never used, nor the SSRX1/SSTX1 pins. The existing binding defines the MIPI DSI/DPI input as port0 and two of the four lanes of output that is probably by default connected to the "DisplayPort Transmitter" as port1 because that's how the crosspoint switch comes out of reset. That leaves the USB3.1 input possibly needing a port in the ports binding, and the other two lanes of output needing a port in the ports binding to describe their connection to the downstream device. And finally information about if the crosspoint switch needs to be registered with the typec framework to do typec things, which can be achieved by the presence of the 'mode-switch' property. On a board like kukui-jacuzzi these new properties and ports wouldn't be specified, because what is there is already sufficient. If this chip is connected to a usb-c-connector then I'd expect to see a connection from the output ports in the graph binding to the connector node's ports. There aren't any ports in the usb-c-connector binding though from what I see. I believe there's also one more use case here where USB3.1 or MIPI DSI/DPI is connected on the input side and this device is used to steer USB3.1 or DP through the crosspoint switch to either of the two output pairs. This last scenario means that we have to describe both output pairs, SSRX1/SSTX1 and SSRX2/SSTX2, as different ports in the binding so they can be connected to different usb-c-connectors if the hardware engineer wired the output pins that way. TL;DR: Can we add 'mode-switch' as an optional property and two more ports at address 2 and 3 for the USB3.1 input and the SSRX1/SSTX1 pair respectively to the existing graph part of this binding? > + }; > + switch@1 { > + compatible = "typec-switch"; > + reg = <1>; > + mode-switch; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + port@0 { > + reg = <0>; > + anx_typec1: endpoint { > + remote-endpoint = <&typec_port1>; > + }; > + }; > + }; > + }; > + }; > }; [1] https://www.analogix.com/en/system/files/AA-002291-PB-6-ANX7625_ProductBrief.pdf