// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * DT overlay for MCIMXHDMICARD as used with the iMX53 QSB or QSRB boards
 */

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>

/dts-v1/;
/plugin/;

&{/} {
	hdmi: connector-hdmi {
		compatible = "hdmi-connector";
		label = "hdmi";
		type = "a";

		port {
			hdmi_connector_in: endpoint {
				remote-endpoint = <&sii9022_out>;
			};
		};
	};

	reg_1p2v: regulator-1p2v {
		compatible = "regulator-fixed";
		regulator-name = "1P2V";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		regulator-always-on;
		vin-supply = <&reg_3p2v>;
	};
};

&display0 {
	status = "okay";

	port@1 {
		display0_out: endpoint {
			remote-endpoint = <&sii9022_in>;
		};
	};
};

&i2c2 {
	#address-cells = <1>;
	#size-cells = <0>;

	sii9022: bridge-hdmi@39 {
		compatible = "sil,sii9022";
		reg = <0x39>;
		reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
		interrupts-extended = <&gpio3 31 IRQ_TYPE_LEVEL_LOW>;
		iovcc-supply = <&reg_3p2v>;
		#sound-dai-cells = <0>;
		sil,i2s-data-lanes = <0>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				sii9022_in: endpoint {
					remote-endpoint = <&display0_out>;
				};
			};

			port@1 {
				reg = <1>;

				sii9022_out: endpoint {
					remote-endpoint = <&hdmi_connector_in>;
				};
			};
		};
	};
};

&panel_dpi {
	status = "disabled";
};
