// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright 2023 Gateworks Corporation
 */

/dts-v1/;
/plugin/;

&{/} {
	compatible = "gateworks,imx8mp-gw74xx", "fsl,imx8mp";

	panel {
		compatible = "powertip,ph800480t013-idf02";
		power-supply = <&attiny>;
		backlight = <&attiny>;

		port {
			panel_in: endpoint {
				remote-endpoint = <&bridge_out>;
			};
		};
	};
};

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

	attiny: regulator@45 {
		compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
		reg = <0x45>;
	};
};

&lcdif1 {
	status = "okay";
};

&mipi_dsi {
	samsung,burst-clock-frequency = <891000000>;
	samsung,esc-clock-frequency = <54000000>;
	samsung,pll-clock-frequency = <27000000>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	bridge@0 {
		compatible = "toshiba,tc358762";
		reg = <0>;
		vddc-supply = <&attiny>;

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

			port@0 {
				reg = <0>;

				bridge_in: endpoint {
					remote-endpoint = <&dsi_out>;
				};
			};

			port@1 {
				reg = <1>;

				bridge_out: endpoint {
					remote-endpoint = <&panel_in>;
				};
			};
		};
	};

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

		port@1 {
			reg = <1>;

			dsi_out: endpoint {
				data-lanes = <1 2>;
				remote-endpoint = <&bridge_in>;
			};
		};
	};
};