#include "kalama-sde-display.dtsi"

&dsi_vtdr6130_amoled_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <10>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <8191>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 133 0>;
};

&dsi_vtdr6130_amoled_video {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <10>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <8191>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 133 0>;
};

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

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

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




&dsi_sim_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
};

&dsi_sim_vid {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
};

&dsi_sim_dsc_375_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
};

&dsi_sim_dsc_10b_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
};

&dsi_dual_sim_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,bl-dsc-cmd-state = "dsi_lp_mode";
};

&dsi_dual_sim_dsc_375_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
};

&dsi_sim_sec_hd_cmd {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_sim>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_supply>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <1023>;
};

&tlmm {
	lt9611_pins: lt9611_pins {
		mux {
			pins = "gpio8", "gpio7", "gpio6", "gpio152";
			function = "gpio";
		};

		config {
			pins = "gpio8", "gpio7", "gpio6", "gpio152";
			drive-strength = <8>;
			bias-disable = <0>;
		};
	};
};

&qupv3_se0_i2c {
	status = "ok";

	lt9611: lt,lt9611@2b {
		compatible = "lt,lt9611uxc";
		reg = <0x2b>;
		interrupt-parent = <&tlmm>;
		interrupts = <44 0>;
		interrupt-names = "lt_irq";
		lt,irq-gpio = <&tlmm 8 0x0>;
		lt,reset-gpio = <&tlmm 7 0x0>;
		lt,hdmi-3p3-en = <&tlmm 6 0x0>;
		lt,hdmi-1p2-en = <&tlmm 152 0x0>;
		lt,non-pluggable;

		pinctrl-names = "default";
		pinctrl-0 = <&lt9611_pins>;

		lt,preferred-mode = "1920x1080";

		lt,customize-modes {
			lt,customize-mode-id@0 {
				lt,mode-h-active = <1920>;
				lt,mode-h-front-porch = <88>;
				lt,mode-h-pulse-width = <44>;
				lt,mode-h-back-porch = <148>;
				lt,mode-h-active-high;
				lt,mode-v-active = <1080>;
				lt,mode-v-front-porch = <4>;
				lt,mode-v-pulse-width = <5>;
				lt,mode-v-back-porch = <36>;
				lt,mode-v-active-high;
				lt,mode-clock-in-khz = <148500>;
			};

			lt,customize-mode-id@1 {
				lt,mode-h-active = <3840>;
				lt,mode-h-front-porch = <176>;
				lt,mode-h-pulse-width = <88>;
				lt,mode-h-back-porch = <400>;
				lt,mode-h-active-high;
				lt,mode-v-active = <2160>;
				lt,mode-v-front-porch = <8>;
				lt,mode-v-pulse-width = <10>;
				lt,mode-v-back-porch = <72>;
				lt,mode-v-active-high;
				lt,mode-clock-in-khz = <608040>;
			};
		};

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

			port@0 {
				reg = <0>;
				lt9611_in_0: endpoint {
					remote-endpoint = <&ext_dsi_0_out>;
				};
			};
		};
	};
};

&sde_dsi {
	qcom,dsi-default-panel = <&dsi_ext_bridge_1080p>;
	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		port@0 {
			reg = <0>;
			ext_dsi_0_out: endpoint {
				remote-endpoint = <&lt9611_in_0>;
			};
		};
	};
};

&qupv3_se4_spi {
	goodix-berlin@0 {
		panel = <&dsi_vtdr6130_amoled_cmd
			 &dsi_vtdr6130_amoled_video>;
	};
};

&battery_charger {
	qcom,display-panels = <&dsi_vtdr6130_amoled_cmd
			      &dsi_vtdr6130_amoled_video>;
};
