#include "waipio-sde-display.dtsi"

&qupv3_se5_i2c {
	nq@64 {
		status = "disabled";
    };
};

&tlmm {
	lt9611_pins: lt9611_pins {
		mux {
			pins = "gpio44", "gpio107", "gpio109", "gpio9";
			function = "gpio";
		};

		config {
			pins = "gpio44", "gpio107", "gpio109", "gpio9";
			drive-strength = <8>;
			bias-disable = <0>;
		};
	};
};

&qupv3_se9_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 44 0x0>;
		lt,reset-gpio = <&tlmm 107 0x0>;
		lt,hdmi-3p3-en = <&tlmm 109 0x0>;
		lt,hdmi-1p2-en = <&tlmm 9 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>;
				};
			};
		};
	};
};

&pm8350_gpios {
	lcd_bias_enable {
		lcd_bias_enable_default: lcd_bias_enable_default {
			pins = "gpio8";
			function = "normal";
			output-enable;
			bias-disable;
			power-source = <1>;       /* 1.8V */
			qcom,drive-strength = <2>;
		};
	};

	lcd_wled_enable {
		lcd_wled_enable_default: lcd_wled_enable_default {
			pins = "gpio9";
			function = "normal";
			output-enable;
			bias-disable;
			power-source = <1>;       /* 1.8V */
			qcom,drive-strength = <2>;
		};
	};
};

&dsi_nt36672c_fhd_plus_90hz_video_cphy {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_no_labibb>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_pwm";
	pwms = <&pm8350c_pwm_2 0 0>;
	qcom,bl-pmic-pwm-period-usecs = <100>;
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <255>;
	qcom,platform-reset-gpio = <&tlmm 0 0>;
	qcom,platform-bklight-en-gpio = <&pm8350_gpios 9 0>;
	qcom,platform-en-gpio = <&pm8350_gpios 8 0>;
};

&sde_dsi {
	pinctrl-names = "panel_active", "panel_suspend", "pwm_pin", "lcd_wled", "lcd_bias";
	pinctrl-2 = <&lcd_backlight_ctrl_default>;
	pinctrl-3 = <&lcd_wled_enable_default>;
	pinctrl-4 = <&lcd_bias_enable_default>;
	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 {
	novatek@0 {
		panel = <&dsi_nt36672c_fhd_plus_90hz_video_cphy>;
	};
};
