/* Copyright (c) 2020, Pixelworks
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include "pxlw-iris7-cfg-samsung-amb670yf07-1440-3216-dsc-cmd.dtsi"
#include "dsi-panel-samsung-amb670yf07-cs-1440-3216-dsc-cmd-2nd.dtsi"
#include "dsi-panel-samsung-amb670yf08-cs-1440-3216-dsc-cmd-2nd.dtsi"
//#include "dsi-panel-boe-nt37705-1080-2412-dsc-cmd-2nd.dtsi"

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

		qcom,panel-supply-entry@0 {
			reg = <0>;
			qcom,supply-name = "px_v18r";
			qcom,supply-min-voltage = <1800000>;
			qcom,supply-max-voltage = <1800000>;
			qcom,supply-enable-load = <62000>;
			qcom,supply-disable-load = <80>;
			qcom,supply-post-on-sleep = <0>;
		};
	};

	/* avoid failed to parse power config */
	dsi_panel_pwr_sec_supply: dsi_panel_pwr_sec_supply {
		#address-cells = <1>;
		#size-cells = <0>;

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

/* select panel */
&mdss_mdp {
	pxlw,dsi-display-primary-active = "qcom,mdss_dsi_panel_samsung_amb670yf07_cs_1440_3216_dsc_cmd";
	pxlw,dsi-display-secondary-active = "qcom,mdss_dsi_panel_samsung_amb670yf07_cs_1440_3216_dsc_cmd_2nd";

	pxlw,dsi-display-primary-active-2nd = "qcom,mdss_dsi_panel_samsung_amb670yf08_cs_1440_3216_dsc_cmd";
	pxlw,dsi-display-secondary-active-2nd = "qcom,mdss_dsi_panel_samsung_amb670yf08_cs_1440_3216_dsc_cmd_2nd";
};

&sde_dsi {
	pxlw,iris-lightup-config = <&mdss_iris_cfg_samsung_amb670yf07_1440_3216_dsc_cmd>;
	px_v18r-supply = <&L12B>;
};

&sde_dsi1 {
	px_v18r-supply = <&L12B>;
};

&dsi_panel_samsung_amb670yf07_cs_1440_3216_dsc_cmd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-ctrl-num = <0>;
	qcom,dsi-phy-num = <0>;
	qcom,iris-supply-entries = <&dsi_iris_pwr_supply>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	//qcom,mdss-dsi-bl-min-level = <1>;
	//qcom,mdss-dsi-bl-max-level = <2047>;
	//qcom,mdss-brightness-max-level = <4095>;
	//qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 133 0>;
};

&dsi_panel_samsung_amb670yf07_cs_1440_3216_dsc_cmd_2nd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-sec-ctrl-num = <1>;
	qcom,dsi-sec-phy-num = <1>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_sec_supply>;
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_external";
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	//qcom,mdss-dsi-bl-min-level = <1>;
	//qcom,mdss-dsi-bl-max-level = <2047>;
	//qcom,mdss-brightness-max-level = <4095>;
	//qcom,mdss-dsi-bl-inverted-dbv;
	qcom,dsi-select-sec-clocks = "pll_byte_clk1", "pll_dsi_clk1";
};

&dsi_vtdr6130_amoled_video {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x3 0x1>;
	qcom,iris-supply-entries = <&dsi_iris_pwr_supply>;
};

/*
&dsi_panel_boe_nt37705_1080_2412_dsc_cmd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-ctrl-num = <0>;
	qcom,dsi-phy-num = <0>;
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
	qcom,iris-supply-entries = <&dsi_iris_pwr_supply>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <2047>;
	qcom,mdss-brightness-max-level = <2047>;
	qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 133 0>;
};
&dsi_panel_boe_nt37705_1080_2412_dsc_cmd_2nd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-sec-ctrl-num = <1>;
	qcom,dsi-sec-phy-num = <1>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_sec_supply>;
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_external";
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <2047>;
	qcom,mdss-brightness-max-level = <2047>;
	qcom,mdss-dsi-bl-inverted-dbv;
};
&dsi_panel_boe_nt37705_1080_2412_dsc_cmd_2nd {
	qcom,dsi-select-sec-clocks = "pll_byte_clk1", "pll_dsi_clk1";
	qcom,mdss-dsi-display-timings {
		timing@sdc_fhd_60{
			qcom,mdss-dsi-panel-clockrate = <1113600000>;
			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>,<2 2 1>;
			qcom,default-topology-index = <1>;
		};
	};
};
*/

&dsi_panel_samsung_amb670yf08_cs_1440_3216_dsc_cmd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-ctrl-num = <0>;
	qcom,dsi-phy-num = <0>;
	qcom,iris-supply-entries = <&dsi_iris_pwr_supply>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	//qcom,mdss-dsi-bl-min-level = <1>;
	//qcom,mdss-dsi-bl-max-level = <2047>;
	//qcom,mdss-brightness-max-level = <4095>;
	//qcom,mdss-dsi-bl-inverted-dbv;
	qcom,platform-reset-gpio = <&tlmm 133 0>;
};

&dsi_panel_samsung_amb670yf08_cs_1440_3216_dsc_cmd_2nd {
	pxlw,iris-chip-capability = <0x1 0x1 0x7 0x7f 0x1>;
	qcom,dsi-sec-ctrl-num = <1>;
	qcom,dsi-sec-phy-num = <1>;
	qcom,panel-sec-supply-entries = <&dsi_panel_pwr_sec_supply>;
	qcom,mdss-dsi-sec-bl-pmic-control-type = "bl_ctrl_external";
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	//qcom,mdss-dsi-bl-min-level = <1>;
	//qcom,mdss-dsi-bl-max-level = <2047>;
	//qcom,mdss-brightness-max-level = <4095>;
	//qcom,mdss-dsi-bl-inverted-dbv;
	qcom,dsi-select-sec-clocks = "pll_byte_clk1", "pll_dsi_clk1";
};