// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
 * Copyright 2025 Josua Mayer <josua@solid-run.com>
 */

/ {
	hdmi-connector {
		compatible = "hdmi-connector";
		label = "hdmi";
		type = "d";

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

	vmipi: regulator-mipi-1-8 {
		compatible = "regulator-fixed";
		regulator-name = "vmipi";
		regulator-always-on;
		regulator-max-microvolt = <1800000>;
		regulator-min-microvolt = <1800000>;
		vin-supply = <&reg_pmic_buck4>;
	};
};

&dsi {
	status = "okay";

	ports {
		port@1 {
			mipi_dsi_out: endpoint {
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&adv7535_from_dsim>;
			};
		};
	};
};

&du {
	status = "okay";
};

&i2c0 {
	hdmi: hdmi@3d {
		compatible = "adi,adv7535";
		reg = <0x3d>, <0x3f>, <0x3c>, <0x38>;
		reg-names = "main", "edid", "cec", "packet";
		a2vdd-supply = <&vmipi>;
		avdd-supply = <&vmipi>;
		dvdd-supply = <&vmipi>;
		pvdd-supply = <&vmipi>;
		v3p3-supply = <&reg_pmic_buck4>;
		adi,dsi-lanes = <4>;

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

			port@0 {
				reg = <0>;

				adv7535_from_dsim: endpoint {
					remote-endpoint = <&mipi_dsi_out>;
				};
			};

			port@1 {
				reg = <1>;

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