[PATCH v5 2/9] dt-bindings: drm/bridge: anx7625: Add mode-switch support

From: Prashant Malani
Date: Wed Jun 22 2022 - 13:39:16 EST


Analogix 7625 can be used in systems to switch USB Type-C DisplayPort
alternate mode lane traffic between 2 Type-C ports.

Update the binding to accommodate this usage by introducing a switch
property.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx>
Tested-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx>
Signed-off-by: Prashant Malani <pmalani@xxxxxxxxxxxx>
---

Changes since v4:
- Added Reviewed-by tags.
- Patch moved to 2/9 position (since Patch v4 1/7 and 2/7 were
applied to usb-next).

Changes since v3:
- Fix unevaluatedProperties usage.
- Add additionalProperties to top level "switches" nodes.
- Make quotes consistent.
- Add '^..$' to regex.
(All suggested by Krzysztof Kozlowski)

Changes since v2:
- Added Reviewed-by and Tested-by tags.

Changes since v1:
- Introduced patternProperties for "switch" children (suggested by
Krzysztof Kozlowski).
- Added unevaluatedProperties descriptor (suggested by Krzysztof
Kozlowski).
- Added "address-cells" and "size-cells" properties to "switches".

.../display/bridge/analogix,anx7625.yaml | 64 +++++++++++++++++++
1 file changed, 64 insertions(+)

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 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ switch@0 {
+ compatible = "typec-switch";
+ reg = <0>;
+ mode-switch;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ anx_typec0: endpoint {
+ remote-endpoint = <&typec_port0>;
+ };
+ };
+ };
+ };
+ 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>;
+ };
+ };
+ };
+ };
+ };
};
};
--
2.37.0.rc0.104.g0611611a94-goog