[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230218111712.2380225-5-treapking@chromium.org>
Date: Sat, 18 Feb 2023 19:17:11 +0800
From: Pin-yen Lin <treapking@...omium.org>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Benson Leung <bleung@...omium.org>
Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org>,
devicetree@...r.kernel.org,
Nicolas Boichat <drinkcat@...omium.org>,
chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
Guenter Roeck <groeck@...omium.org>,
Matthias Brugger <matthias.bgg@...il.com>,
dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org,
Philipp Zabel <p.zabel@...gutronix.de>,
linux-arm-kernel@...ts.infradead.org,
Pin-yen Lin <treapking@...omium.org>
Subject: [PATCH v3 4/5] dt-bindings: display: bridge: Add GPIO display mux binding
From: Nicolas Boichat <drinkcat@...omium.org>
Add bindings for Generic GPIO mux driver.
Signed-off-by: Nicolas Boichat <drinkcat@...omium.org>
Signed-off-by: Pin-yen Lin <treapking@...omium.org>
---
Rob mentioned that this series can probably use the common MUX bindings.
Those bindings are designed for MUX consumers that requests a certain
MUX configuration, while this driver is reading a GPIO pin controlled
by the other parts of the system (in our use case, it's the embedded
controller firmware).
Changes in v3:
- Removed ddc-i2c-bus in the bindings
Changes in v2:
- Referenced existing dt-binding schemas from graph.yaml
- Added ddc-i2c-bus into the bindings
.../bindings/display/bridge/gpio-mux.yaml | 90 +++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
diff --git a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
new file mode 100644
index 000000000000..e6b82ea2f45c
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic display mux (1 input, 2 outputs)
+
+maintainers:
+ - Nicolas Boichat <drinkcat@...omium.org>
+
+description: |
+ This bindings describes a simple display (e.g. HDMI) mux, that has 1
+ input, and 2 outputs. The mux status is controlled by hardware, and
+ its status is read back using a GPIO.
+
+properties:
+ compatible:
+ const: gpio-display-mux
+
+ detect-gpios:
+ maxItems: 1
+ description: GPIO that indicates the active output
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: |
+ Video port for input.
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: |
+ 2 video ports for output.
+ The reg value in the endpoints matches the GPIO status: when
+ GPIO is asserted, endpoint with reg value <1> is selected.
+
+ required:
+ - port@0
+ - port@1
+
+required:
+ - compatible
+ - detect-gpios
+ - ports
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ hdmi_mux: hdmi_mux {
+ compatible = "gpio-display-mux";
+ detect-gpios = <&pio 36 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&hdmi_mux_pins>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 { /* input */
+ reg = <0>;
+
+ hdmi_mux_in: endpoint {
+ remote-endpoint = <&hdmi0_out>;
+ };
+ };
+
+ port@1 { /* output */
+ reg = <1>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ hdmi_mux_out_anx: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dp_bridge_in>;
+ };
+
+ hdmi_mux_out_hdmi: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+ };
+ };
+ };
--
2.39.2.637.g21b0678d19-goog
Powered by blists - more mailing lists