#include "cape-sde-display.dtsi"
#include "dsi-panel-l12-42-02-0a-dsc-cmd.dtsi"
#include "dsi-panel-l12-36-02-0b-dsc-cmd.dtsi"

&soc {
	dsi_panel_pwr_supply_L12: dsi_panel_pwr_supply_L12 {
		#address-cells = <1>;
		#size-cells = <0>;
		qcom,panel-supply-entry@0 {
			reg = <0>;
			qcom,supply-name = "vddio";
			qcom,supply-min-voltage = <1800000>;
			qcom,supply-max-voltage = <1800000>;
			qcom,supply-enable-load = <300000>;
			qcom,supply-disable-load = <80>;
			qcom,supply-post-on-sleep = <20>;
			qcom,supply-post-off-sleep = <10>;
		};
		qcom,panel-supply-entry@1 {
			reg = <1>;
			qcom,supply-name = "vddd";
			qcom,supply-min-voltage = <1200000>;
			qcom,supply-max-voltage = <1200000>;
			qcom,supply-enable-load = <300000>;
			qcom,supply-disable-load = <0>;
			qcom,supply-post-on-sleep = <20>;
			qcom,supply-post-off-sleep = <10>;
		};
		qcom,panel-supply-entry@2 {
			reg = <2>;
			qcom,supply-name = "vci";
			qcom,supply-min-voltage = <3000000>;
			qcom,supply-max-voltage = <3000000>;
			qcom,supply-enable-load = <300000>;
			qcom,supply-disable-load = <0>;
			qcom,supply-post-on-sleep = <15>;
			qcom,supply-pre-on-sleep = <10>;
			qcom,supply-post-off-sleep = <10>;
		};
	};
};

&soc {
	display_panel_vddd: display_panel_vddd {
		compatible = "regulator-fixed";
		regulator-name = "display_panel_vddd";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		gpio = <&tlmm 66 0>;
		enable-active-high;
		regulator-boot-on;
	};
};

&sde_dsi {
	qcom,dsi-default-panel = <&dsi_r66451_amoled_video>;
	vddd-supply = <&display_panel_vddd>;
	vci-supply = <&L13C>;
	vddio-supply = <&L12C>;
};

&dsi_r66451_amoled_video {
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <255>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 0 0>;
	/delete-property/ qcom,esd-check-enabled;
};

&dsi_l12_42_02_0a_dsc_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_L12>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <8>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <4095>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 0 0>;
};

&dsi_l12_36_02_0b_dsc_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_L12>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <8>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <4095>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 0 0>;
};

&dsi_l12_42_02_0a_dsc_cmd  {
	qcom,ulps-enabled;
	qcom,dsi-select-clocks = "pll_byte_clk0", "pll_dsi_clk0";
		qcom,mdss-dsi-display-timings {
		/* 60 Hz */
		timing@0{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
		/* 120 Hz */
		timing@1{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
		/* 90 Hz */
		timing@2{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <2 2 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&dsi_l12_36_02_0b_dsc_cmd  {
	qcom,ulps-enabled;
	qcom,dsi-select-clocks = "pll_byte_clk0", "pll_dsi_clk0";
		qcom,mdss-dsi-display-timings {
		/* 60 Hz */
		timing@0{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <1 1 1>;
			qcom,default-topology-index = <0>;
		};
		/* 120 Hz */
		timing@1{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <1 1 1>;
			qcom,default-topology-index = <0>;
		};
		/* 90 Hz */
		timing@2{
			qcom,mdss-dsi-panel-phy-timings = [00 24 0A 0A 1A 25 09
				0A 09 02 04 00 1E 0F];
			qcom,display-topology = <1 1 1>;
			qcom,default-topology-index = <0>;
		};
	};
};

&mdss_mdp {
	connectors = <&sde_dsi &smmu_sde_unsec &smmu_sde_sec &sde_wb &sde_rscc>;
};

&qupv3_se4_spi {
	xiaomi_touch@0  {
		panel = <&dsi_l12_42_02_0a_dsc_cmd
			&dsi_l12_36_02_0b_dsc_cmd
			&dsi_r66451_amoled_video>;
	};
};

&soc {
	thermal-message {
		board-sensor = "VIRTUAL-SENSOR0";
	};
	thermal_screen: thermal-screen {
		panel = <&dsi_l12_42_02_0a_dsc_cmd
			&dsi_l12_36_02_0b_dsc_cmd
			&dsi_r66451_amoled_video>;
	};
	charge_screen: charge-screen {
		panel = <&dsi_l12_42_02_0a_dsc_cmd
			&dsi_l12_36_02_0b_dsc_cmd
			&dsi_r66451_amoled_video>;
	};
	xiaomi-touch  {
		panel-primary = <&dsi_l12_42_02_0a_dsc_cmd
			&dsi_l12_36_02_0b_dsc_cmd
			&dsi_r66451_amoled_video>;
	};
};
