From: Stephen Boyd <swboyd@chromium.org>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
devicetree@vger.kernel.org,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Rob Herring" <robh@kernel.org>,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Conor Dooley" <conor+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Lee Jones" <lee@kernel.org>,
"Benson Leung" <bleung@chromium.org>,
"Guenter Roeck" <groeck@chromium.org>,
chrome-platform@lists.linux.dev,
"Pin-yen Lin" <treapking@chromium.org>,
"Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
"Łukasz Bartosik" <ukaszb@chromium.org>,
"Jameson Thies" <jthies@google.com>,
"Andrei Kuchynski" <akuchynski@chromium.org>
Subject: [PATCH 5/7] dt-bindings: usb: google,cros-ec-typec: Add ports for DP altmode
Date: Tue, 15 Apr 2025 17:02:05 -0700 [thread overview]
Message-ID: <20250416000208.3568635-6-swboyd@chromium.org> (raw)
In-Reply-To: <20250416000208.3568635-1-swboyd@chromium.org>
Add a DT graph binding to google,cros-ec-typec so that it can combine
DisplayPort (DP) and USB SuperSpeed (SS) data into a USB type-c endpoint
that is connected to the usb-c-connector node's SS endpoint. Allow there
to be multiple 'typec' nodes underneath the EC node so that one DT graph
exists per DP bridge. The EC is actually controlling TCPCs and redrivers
that combine the DP and USB signals together so this more accurately
reflects the hardware design without introducing yet another DT node
underneath the EC for USB type-c "stuff".
If the type-c ports are being shared between a single DP controller then
the ports need to know about each other and determine a policy to drive
DP to one type-c port or the other. If the type-c ports each have their
own dedicated DP controller then they're able to operate independently
and enter/exit DP altmode independently as well. We can't connect the DP
controller's endpoint to one usb-c-connector port@1 endpoint and the USB
controller's endpoint to another usb-c-connector port@1 endpoint either
because the DP muxing case would have DP connected to two
usb-c-connector endpoints which the graph binding doesn't support.
Therefore, one typec node is required per the capabilities of the type-c
port(s) being managed. Add a port to the DisplayPort altmode as well, so
that we can show the connection between the DP controller and the DP
altmode. This lets us indicate which type-c ports the DP controller is
wired to. For example, if DP was connected to ports 0 and 2, while port
1 was connected to another DP controller we wouldn't be able to
implement that without having some other DT property to indicate which
output ports are connected to the DP endpoint.
Furthermore, this supports ChromeOS designs like Corsola where a DP
controller/PHY is split with two lanes going to one connector and the
other two lanes going to another connector. In this case, we wouldn't
have the graph binding under the cros-ec-typec node, but we would have
the graph binding in the DP altmode directly connected to the DP
controller's two output endpoints.
Cc: Rob Herring (Arm) <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Conor Dooley <conor+dt@kernel.org>
Acked-by: Lee Jones <lee@kernel.org>
Cc: Benson Leung <bleung@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: <devicetree@vger.kernel.org>
Cc: <chrome-platform@lists.linux.dev>
Cc: Pin-yen Lin <treapking@chromium.org>
Cc: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Cc: Łukasz Bartosik <ukaszb@chromium.org>
Cc: Jameson Thies <jthies@google.com>
Cc: Andrei Kuchynski <akuchynski@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
.../bindings/connector/usb-connector.yaml | 6 +
.../bindings/mfd/google,cros-ec.yaml | 7 +-
.../bindings/usb/google,cros-ec-typec.yaml | 165 ++++++++++++++++++
3 files changed, 175 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
index 11e40d225b9f..e3d60997c03e 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
+++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
@@ -179,6 +179,12 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
description: VDO returned by Discover Modes USB PD command.
+ port:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: OF graph bindings modeling a data bus to the
+ DisplayPort altmode from the DisplayPort controller. Used when
+ the altmode switch is part of the port manager.
+
port:
$ref: /schemas/graph.yaml#/properties/port
description: OF graph bindings modeling a data bus to the connector, e.g.
diff --git a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
index ac89696fa649..63d506e88abb 100644
--- a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
+++ b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
@@ -98,9 +98,6 @@ properties:
gpio-controller: true
- typec:
- $ref: /schemas/usb/google,cros-ec-typec.yaml#
-
ec-pwm:
$ref: /schemas/pwm/google,cros-ec-pwm.yaml#
deprecated: true
@@ -163,6 +160,10 @@ patternProperties:
type: object
$ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#
+ "^typec(-[0-9])*$":
+ type: object
+ $ref: /schemas/usb/google,cros-ec-typec.yaml#
+
required:
- compatible
diff --git a/Documentation/devicetree/bindings/usb/google,cros-ec-typec.yaml b/Documentation/devicetree/bindings/usb/google,cros-ec-typec.yaml
index 3272d0e01f7e..611345bbe884 100644
--- a/Documentation/devicetree/bindings/usb/google,cros-ec-typec.yaml
+++ b/Documentation/devicetree/bindings/usb/google,cros-ec-typec.yaml
@@ -26,6 +26,55 @@ properties:
'#size-cells':
const: 0
+ mux-gpios:
+ description: GPIOs indicating which way the DisplayPort mux is steered
+ minItems: 1
+ maxItems: 3
+
+ no-hpd:
+ description: Indicates this device doesn't signal HPD for DisplayPort
+ type: boolean
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description:
+ Port for DisplayPort (DP) data
+
+ properties:
+ endpoint@0:
+ $ref: /schemas/graph.yaml#/properties/endpoint
+ description: Input DP port
+
+ patternProperties:
+ '^endpoint@[1-8]$':
+ $ref: /schemas/graph.yaml#/properties/endpoint
+ description: Output to the usb-c connector's DP altmode
+
+ required:
+ - endpoint@0
+
+ anyOf:
+ - required:
+ - endpoint@1
+ - required:
+ - endpoint@2
+ - required:
+ - endpoint@3
+ - required:
+ - endpoint@4
+ - required:
+ - endpoint@5
+ - required:
+ - endpoint@6
+ - required:
+ - endpoint@7
+ - required:
+ - endpoint@8
+
patternProperties:
'^connector@[0-9a-f]+$':
$ref: /schemas/connector/usb-connector.yaml#
@@ -35,10 +84,30 @@ patternProperties:
required:
- compatible
+allOf:
+ - if:
+ required:
+ - no-hpd
+ then:
+ properties:
+ ports:
+ required:
+ - port@0
+ - if:
+ required:
+ - mux-gpios
+ then:
+ properties:
+ ports:
+ required:
+ - port@0
+
additionalProperties: false
examples:
- |+
+ #include <dt-bindings/gpio/gpio.h>
+
spi {
#address-cells = <1>;
#size-cells = <0>;
@@ -47,6 +116,8 @@ examples:
compatible = "google,cros-ec-spi";
reg = <0>;
interrupts = <35 0>;
+ #gpio-cells = <2>;
+ gpio-controller;
typec {
compatible = "google,cros-ec-typec";
@@ -54,12 +125,106 @@ examples:
#address-cells = <1>;
#size-cells = <0>;
+ mux-gpios = <&cros_ec 42 GPIO_ACTIVE_HIGH>, <&cros_ec 3 GPIO_ACTIVE_HIGH>;
+
connector@0 {
compatible = "usb-c-connector";
reg = <0>;
power-role = "dual";
data-role = "dual";
try-power-role = "source";
+
+ altmodes {
+ displayport {
+ port {
+ usbc0_dp: endpoint {
+ remote-endpoint = <&dp_out0>;
+ };
+ };
+ };
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ usb_c0_hs: endpoint {
+ remote-endpoint = <&usb_hub_dfp3_hs>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ usb_c0_ss: endpoint {
+ remote-endpoint = <&usb_hub_dfp3_ss>;
+ };
+ };
+ };
+ };
+
+ connector@1 {
+ compatible = "usb-c-connector";
+ reg = <1>;
+ power-role = "dual";
+ data-role = "dual";
+ try-power-role = "source";
+
+ altmodes {
+ displayport {
+ port {
+ usbc1_dp: endpoint {
+ remote-endpoint = <&dp_out1>;
+ };
+ };
+ };
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ usb_c1_hs: endpoint {
+ remote-endpoint = <&usb_hub_dfp2_hs>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ usb_c1_ss: endpoint {
+ remote-endpoint = <&usb_hub_dfp2_ss>;
+ };
+ };
+ };
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dp_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dp_phy>;
+ };
+
+ dp_out0: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&usbc0_dp>;
+ };
+
+ dp_out1: endpoint@2 {
+ reg = <2>;
+ remote-endpoint = <&usbc1_dp>;
+ };
+ };
};
};
};
--
https://chromeos.dev
next prev parent reply other threads:[~2025-04-16 0:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 0:02 [PATCH 0/7] platform/chrome: Support for USB DP altmode muxing w/ DT Stephen Boyd
2025-04-16 0:02 ` [PATCH 1/7] platform/chrome: cros_ec_typec: No pending status means attention Stephen Boyd
2025-04-22 13:38 ` Dmitry Baryshkov
2025-04-28 23:55 ` Stephen Boyd
2025-04-29 6:46 ` Dmitry Baryshkov
2025-04-16 0:02 ` [PATCH 2/7] platform/chrome: cros_ec_typec: Allow DP configure to work Stephen Boyd
2025-04-22 13:37 ` Dmitry Baryshkov
2025-04-29 6:46 ` Dmitry Baryshkov
2025-04-16 0:02 ` [PATCH 3/7] platform/chrome: cros_ec_typec: Support EC mode entry Stephen Boyd
2025-04-16 0:02 ` [PATCH 4/7] dt-bindings: Move google,cros-ec-typec binding to usb Stephen Boyd
2025-04-16 6:44 ` Lee Jones
2025-04-16 0:02 ` Stephen Boyd [this message]
2025-04-22 12:18 ` [PATCH 5/7] dt-bindings: usb: google,cros-ec-typec: Add ports for DP altmode Rob Herring
2025-04-29 5:01 ` Stephen Boyd
2025-04-24 11:10 ` Dmitry Baryshkov
2025-04-16 0:02 ` [PATCH 6/7] platform/chrome: cros_ec_typec: Add support for DP altmode via drm_bridge Stephen Boyd
2025-04-24 10:51 ` Dmitry Baryshkov
2025-04-29 21:57 ` Stephen Boyd
2025-04-16 0:02 ` [PATCH 7/7] platform/chrome: cros_ec_typec: Support DP muxing Stephen Boyd
2025-04-24 11:03 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250416000208.3568635-6-swboyd@chromium.org \
--to=swboyd@chromium.org \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@chromium.org \
--cc=andersson@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=groeck@chromium.org \
--cc=jthies@google.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=robh@kernel.org \
--cc=treapking@chromium.org \
--cc=tzungbi@kernel.org \
--cc=ukaszb@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox