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

From: Prashant Malani
Date: Wed Jun 22 2022 - 13:44:36 EST


From: Pin-Yen Lin <treapking@xxxxxxxxxxxx>

ITE IT6505 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.

Signed-off-by: Pin-Yen Lin <treapking@xxxxxxxxxxxx>
Signed-off-by: Prashant Malani <pmalani@xxxxxxxxxxxx>
---

v5 is the first version for this patch.

.../bindings/display/bridge/ite,it6505.yaml | 97 ++++++++++++++++++-
1 file changed, 96 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml b/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml
index 833d11b2303a..86bb6dc5ae6f 100644
--- a/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml
@@ -56,13 +56,46 @@ properties:
$ref: /schemas/graph.yaml#/properties/port
description: A port node pointing to DPI host port node

+ 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
- ovdd-supply
- pwr18-supply
- interrupts
- reset-gpios
- - extcon
+
+oneOf:
+ - required:
+ - extcon
+ - required:
+ - switches

additionalProperties: false

@@ -92,3 +125,65 @@ examples:
};
};
};
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ i2c3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ it6505dptx: it6505dptx@5c {
+ compatible = "ite,it6505";
+ interrupts = <8 IRQ_TYPE_LEVEL_LOW 8 0>;
+ reg = <0x5c>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&it6505_pins>;
+ ovdd-supply = <&mt6366_vsim2_reg>;
+ pwr18-supply = <&pp1800_dpbrdg_dx>;
+ reset-gpios = <&pio 177 0>;
+
+ port {
+ it6505_dp_in: endpoint {
+ remote-endpoint = <&dpi_out>;
+ };
+ };
+
+ 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>;
+ ite_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>;
+ ite_typec1: endpoint {
+ remote-endpoint = <&typec_port1>;
+ };
+ };
+ };
+ };
+ };
+ };
+ };
--
2.37.0.rc0.104.g0611611a94-goog