#include "dsi-panel-r66451-dsc-fhd-plus-video.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-60hz-video.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-cmd.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-60hz-cmd.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-144hz-cmd.dtsi"
#include "dsi-panel-sharp-dsc-qhd-plus-video.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-video-cphy.dtsi"
#include "dsi-panel-sharp-dsc-qhd-plus-cmd.dtsi"
#include "dsi-panel-r66451-dsc-fhd-plus-cmd-cphy.dtsi"
#include "dsi-panel-sim-video.dtsi"
#include <dt-bindings/clock/mdss-5nm-pll-clk.h>

&soc {
	dsi_panel_pwr_supply: dsi_panel_pwr_supply {
		#address-cells = <1>;
		#size-cells = <0>;

		qcom,panel-supply-entry@0 {
			reg = <0>;
			qcom,supply-name = "vddio";
			qcom,supply-min-voltage = <1820000>;
			qcom,supply-max-voltage = <1820000>;
			qcom,supply-enable-load = <60700>;
			qcom,supply-disable-load = <80>;
			qcom,supply-post-on-sleep = <20>;
		};

		qcom,panel-supply-entry@1 {
			reg = <1>;
			qcom,supply-name = "vdd";
			qcom,supply-min-voltage = <3000000>;
			qcom,supply-max-voltage = <3000000>;
			qcom,supply-enable-load = <30000>;
			qcom,supply-disable-load = <0>;
			qcom,supply-post-on-sleep = <0>;
		};

		qcom,panel-supply-entry@2 {
			reg = <2>;
			qcom,supply-name = "lab";
			qcom,supply-min-voltage = <4600000>;
			qcom,supply-max-voltage = <6000000>;
			qcom,supply-enable-load = <0>;
			qcom,supply-disable-load = <0>;
		};

		qcom,panel-supply-entry@3 {
			reg = <3>;
			qcom,supply-name = "ibb";
			qcom,supply-min-voltage = <4600000>;
			qcom,supply-max-voltage = <6000000>;
			qcom,supply-enable-load = <0>;
			qcom,supply-disable-load = <0>;
			qcom,supply-post-on-sleep = <20>;
		};
	};

	sde_dsi: qcom,dsi-display-primary {
		compatible = "qcom,dsi-display";
		label = "primary";

		qcom,dsi-ctrl = <&mdss_dsi0 &mdss_dsi1>;
		qcom,dsi-phy = <&mdss_dsi_phy0 &mdss_dsi_phy1>;

		qcom,mdp = <&mdss_mdp>;
	};

	sde_dsi1: qcom,dsi-display-secondary {
		compatible = "qcom,dsi-display";
		label = "secondary";

		qcom,dsi-ctrl = <&mdss_dsi0 &mdss_dsi1>;
		qcom,dsi-phy = <&mdss_dsi_phy0 &mdss_dsi_phy1>;

		qcom,mdp = <&mdss_mdp>;
	};
};

&dsi_r66451_amoled_video {
	qcom,dsi-supported-dfps-list = <120 90 60 48>;
	qcom,mdss-dsi-pan-enable-dynamic-fps;
	qcom,mdss-dsi-min-refresh-rate = <48>;
	qcom,mdss-dsi-max-refresh-rate = <120>;
	qcom,mdss-dsi-pan-fps-update = "dfps_immediate_porch_mode_vfp";
	qcom,mdss-dsi-qsync-min-refresh-rate = <48>;
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0",
				"src_byte_clk0", "src_pixel_clk0",
				"shadow_byte_clk0", "shadow_pixel_clk0";
	qcom,dsi-dyn-clk-enable;
	qcom,dsi-dyn-clk-list =
		<846374400 842847840 844611120>;
	qcom,dsi-dyn-clk-type = "constant-fps-adjust-hfp";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 1b 08 07 0d 0b 08
				08 05 02 04 00 17 0c];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_60hz_video {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,dsi-select-sec-clocks = "mux_byte_clk1", "mux_pixel_clk1";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 10 04 04 12 11 04
				04 03 02 04 00 0e 09];
			qcom,display-topology = <1 1 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_60hz_cmd {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,dsi-select-sec-clocks = "mux_byte_clk1", "mux_pixel_clk1";
	qcom,dsi-dyn-clk-enable;
	qcom,dsi-dyn-clk-list =
		<327096550 325733640 328459448>;
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 0e 03 03 1e 1d 04
				03 03 02 04 00 0f 13];
			qcom,display-topology = <1 1 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_144hz_cmd {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 22 09 09 19 17 09
					09 09 02 04 00 1d 0e];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_sharp_qhd_plus_dsc_video {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 { /* 120 FPS */
			qcom,mdss-dsi-panel-phy-timings = [00 1a 07 06 16 15 07
					07 07 02 04 00 17 0b];
			qcom,display-topology = <2 2 2>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_video_cphy {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0",
				"cphy_byte_clk0", "cphy_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 00 00 00 1e 17 04
					19 03 02 04 00 00 00];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_sharp_qhd_plus_dsc_cmd {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 { /* 120 FPS */
			qcom,mdss-dsi-panel-phy-timings = [00 1a 07 06 16 15 07
					07 07 02 04 00 17 0b];
			qcom,display-topology = <2 2 2>;
			qcom,default-topology-index = <0>;
		};

		timing@1 { /* 60 FPS*/
			qcom,mdss-dsi-panel-phy-timings = [00 1a 07 06 16 15 07
					07 07 02 04 00 17 0b];
			qcom,display-topology = <2 2 2>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_cmd_cphy {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0",
				"cphy_byte_clk0", "cphy_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 00 00 00 1e 17 04
					19 03 02 04 00 00 00];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_r66451_amoled_cmd {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,dsi-select-sec-clocks = "mux_byte_clk1", "mux_pixel_clk1";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [00 10 04 04 12 1e 04
				04 03 02 04 00 0e 09];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};

		timing@1 {
			qcom,mdss-dsi-panel-phy-timings = [00 16 06 05 14 1f 06
				06 06 02 04 00 14 0a];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};

		timing@2 {
			qcom,mdss-dsi-panel-phy-timings = [00 1c 08 07 17 16 07
				07 08 02 04 00 19 0c];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_sim_vid {
	qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
	qcom,mdss-dsi-display-timings {
		timing@0 {
			qcom,mdss-dsi-panel-phy-timings = [01 05 01 01 03 03 01
				01 01 02 04 00 06 06];
			qcom,display-topology = <1 0 1>,
						<2 0 1>;
			qcom,default-topology-index = <0>;
		};
	};
};
