// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2023 Rockchip Electronics Co., Ltd.
 *
 */

#include <dt-bindings/display/media-bus-format.h>
#include "rk3562-evb1-lp4x-v10.dtsi"
#include "rk3562-android.dtsi"
#include "rk3562-rk817.dtsi"

/ {
	model = "Rockchip RK3562 EVB1 LP4X V10 Board + RK EVB SII9022 RGB2HDMI DISPLAY Ext Board";
	compatible = "rockchip,rk3562-evb1-lp4x-v10-sii9022-rgb2hdmi", "rockchip,rk3562";
};

&dsi {
	status = "disabled";
};

&dsi_in_vp0 {
	status = "disabled";
};

/*
 * The pins of gmac0 and rgb are multiplexed
 */
&gmac0 {
	status = "disabled";
};

&i2c3 {
	clock-frequency = <400000>;
	pinctrl-0 = <&i2c3m0_xfer>;
	status = "okay";

	sii9022: sii9022@39 {
		compatible = "sil,sii9022";
		reg = <0x39>;
		pinctrl-names = "default";
		pinctrl-0 = <&sii902x_hdmi>;
		interrupt-parent = <&gpio3>;
		interrupts = <RK_PA7 IRQ_TYPE_LEVEL_HIGH>;
		reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
		enable-gpio = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;
		bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;
		status = "okay";

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

			port@0 {
				reg = <0>;

				sii9022_in_rgb: endpoint {
					remote-endpoint = <&rgb_out_sii9022>;
				};
			};
		};
	};
};

/*
 * The pins of pcie2x1/pdm_codec and rgb are multiplexed
 */
&pcie2x1 {
	status = "disabled";
};

&pdm_codec {
	status = "disabled";
};

&pinctrl {
	sii902x {
		sii902x_hdmi: sii902x-hdmi {
			rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};
};

&rgb {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&vo_pins>;

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

			rgb_out_sii9022: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&sii9022_in_rgb>;
			};
		};
	};
};

&rgb_in_vp0 {
	status = "okay";
};

&route_rgb {
	status = "disabled";
	connect = <&vp0_out_rgb>;
};

/*
 * The pins of sai0/vcc_mipicsi0/u2phy_host and rgb are multiplexed
 */
&sai0 {
	status = "disabled";
};

&u2phy_host {
	status = "disabled";
};

&vcc5v0_usb_host {
	status = "disabled";
};

&vcc_mipicsi0 {
	status = "disabled";
};

&video_phy {
	status = "disabled";
};
