#include <dt-bindings/msm-camera.h>

&soc {
	led_flash_triple_rear_wide: qcom,camera-flash0 {
		cell-index = <0>;
		compatible = "qcom,camera-flash";
		qcom,flash-name = "pmic";
		flash-source = <&pm8550_flash0 &pm8550_flash1>;
		torch-source = <&pm8550_torch0 &pm8550_torch1>;
		switch-source = <&pm8550_switch2>;
		status = "ok";
	};

	led_flash_triple_rear_ultrawide: qcom,camera-flash1 {
		cell-index = <1>;
		compatible = "qcom,camera-flash";
		flash-source = <&pm8550_flash0 &pm8550_flash1>;
		torch-source = <&pm8550_torch0 &pm8550_torch1>;
		switch-source = <&pm8550_switch2>;
		status = "ok";
	};

	led_flash_triple_rear_tele: qcom,camera-flash2 {
		cell-index = <2>;
		compatible = "qcom,camera-flash";
		flash-source = <&pm8550_flash0 &pm8550_flash1>;
		torch-source = <&pm8550_torch0 &pm8550_torch1>;
		switch-source = <&pm8550_switch2>;
		status = "ok";
	};

	camera_vdig_aux_ldo: gpio-regulator@0 {
		compatible = "regulator-fixed";
		reg = <0x00 0x00>;
		regulator-name = "camera_vdig_aux_ldo";
		regulator-min-microvolt = <1824000>;
		regulator-max-microvolt = <1824000>;
		regulator-enable-ramp-delay = <135>;
		enable-active-high;
		gpio = <&pm8550vs_c_gpios 4 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&cam_sensor_vdig_aux_default>;
		//vin-supply = <&S6G>;
	};

	qcom,cam-res-mgr {
		compatible = "qcom,cam-res-mgr";
		status = "ok";
	};

	cam_csiphy1: qcom,csiphy1@ace6000 {
		cell-index = <1>;
		compatible = "qcom,csiphy-v2.1.2-enhance", "qcom,csiphy";
		reg = <0xace6000 0x2000>;
		reg-names = "csiphy";
		reg-cam-base = <0xe6000>;
		interrupt-names = "CSIPHY1";
		interrupts = <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>;
		regulator-names = "gdscr", "csi-vdd-1p2", "csi-vdd-0p9";
		gdscr-supply = <&cam_cc_titan_top_gdsc>;
		csi-vdd-1p2-supply = <&L3E>;
		csi-vdd-0p9-supply = <&L1E>;
		rgltr-cntrl-support;
		rgltr-min-voltage = <0 1200000 875000>;
		rgltr-max-voltage = <0 1200000 925000>;
		rgltr-load-current = <0 18000 32200>;
		shared-clks = <1 0 0 0>;
		clock-names = "cphy_rx_clk_src",
			"csiphy1_clk",
			"csi1phytimer_clk_src",
			"csi1phytimer_clk";
		clocks = <&camcc CAM_CC_CPHY_RX_CLK_SRC>,
			<&camcc CAM_CC_CSIPHY1_CLK>,
			<&camcc CAM_CC_CSI1PHYTIMER_CLK_SRC>,
			<&camcc CAM_CC_CSI1PHYTIMER_CLK>;
		src-clock-name = "csi1phytimer_clk_src";
		clock-cntl-level = "lowsvs", "nominal";
		clock-rates =
			<400000000 0 400000000 0>,
			<480000000 0 400000000 0>;
		status = "ok";
	};

	cam_csiphy2: qcom,csiphy2@ace8000 {
		cell-index = <2>;
		compatible = "qcom,csiphy-v2.1.2-enhance", "qcom,csiphy";
		reg = <0xace8000 0x2000>;
		reg-names = "csiphy";
		reg-cam-base = <0xe8000>;
		interrupt-names = "CSIPHY2";
		interrupts = <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>;
		regulator-names = "gdscr", "csi-vdd-1p2", "csi-vdd-0p9";
		gdscr-supply = <&cam_cc_titan_top_gdsc>;
		csi-vdd-1p2-supply = <&L3E>;
		csi-vdd-0p9-supply = <&L1E>;
		rgltr-cntrl-support;
		rgltr-min-voltage = <0 1200000 875000>;
		rgltr-max-voltage = <0 1200000 925000>;
		rgltr-load-current = <0 18000 32200>;
		shared-clks = <1 0 0 0>;
		clock-names = "cphy_rx_clk_src",
			"csiphy2_clk",
			"csi2phytimer_clk_src",
			"csi2phytimer_clk";
		clocks = <&camcc CAM_CC_CPHY_RX_CLK_SRC>,
			<&camcc CAM_CC_CSIPHY2_CLK>,
			<&camcc CAM_CC_CSI2PHYTIMER_CLK_SRC>,
			<&camcc CAM_CC_CSI2PHYTIMER_CLK>;
		src-clock-name = "csi2phytimer_clk_src";
		clock-cntl-level = "lowsvs", "nominal";
		clock-rates =
			<400000000 0 400000000 0>,
			<480000000 0 400000000 0>;
		status = "ok";
	};

};

&cam_cci0 {
	actuator_triple_main: qcom,actuator0 {
		cell-index = <0>;
		compatible = "qcom,actuator";
		cci-master = <CCI_MASTER_0>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L6M>;
		regulator-names = "cam_vio", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2800000>;
		rgltr-max-voltage = <1800000 2800000>;
		rgltr-load-current = <600000 300000>;
		status = "ok";
	};

	ois_rear: qcom,ois@0{
		cell-index = <0>;
		compatible = "qcom,ois";
		cci-master = <CCI_MASTER_0>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L6M>;
		cam_v_custom2-supply = <&L4M>;
		regulator-names = "cam_vio", "cam_vaf","cam_v_custom2";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2800000 2800000>;
		rgltr-max-voltage = <1800000 2800000 2800000>;
		rgltr-load-current = <600000 300000 300000>;
		ois_gyro,position=<3>;
		ois_gyro,type=<3>;
		ois,type=<0>;
		ois,name="bu63169";
		ois_module,vendor=<1>;
		ois_actuator,vednor=<2>;
		ois,fw=<1>;
		status = "ok";
	};

	eeprom_main: qcom,eeprom0 {
		cell-index = <0>;
		compatible = "qcom,eeprom";
		cam_vana-supply = <&L3M>;
		cam_v_custom1-supply = <&L5M>;
		cam_vdig-supply = <&L1M>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L6M>;
		cam_v_custom2-supply = <&L4M>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_v_custom1", "cam_vdig", "cam_vio", "cam_vaf", "cam_v_custom2",
		                  "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000 1800000 1104000 1800000 2800000 2800000 0>;
		rgltr-max-voltage = <2800000 1800000 1104000 1800000 2800000 2800000 0>;
		rgltr-load-current = <300000 600000 1200000 600000 300000 300000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk2_active
			&cam_sensor_active_rst1>;
		pinctrl-1 = <&cam_sensor_mclk2_suspend
			&cam_sensor_suspend_rst1>;
		gpios = <&tlmm 102 0>,
			<&tlmm 117 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK2",
					"CAM_RESET1";
		cci-master = <CCI_MASTER_0>;
		clocks = <&camcc CAM_CC_MCLK2_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

    //main camera
	qcom,cam-sensor0 {
		cell-index = <0>;
		compatible = "qcom,cam-sensor";
		csiphy-sd-index = <2>;
		sensor-position-roll = <90>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <180>;
		eeprom-src = <&eeprom_main>;
		actuator-src = <&actuator_triple_main>;
		ois-src = <&ois_rear>;
		led-flash-src = <&led_flash_triple_rear_wide>;
		cam_vana-supply = <&L3M>;
		cam_v_custom1-supply = <&L5M>;
		cam_vdig-supply = <&L1M>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L6M>;
		cam_v_custom2-supply = <&L4M>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_v_custom1", "cam_vdig", "cam_vio", "cam_vaf", "cam_v_custom2",
		                  "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000 1800000 1104000 1800000 2800000 2800000 0>;
		rgltr-max-voltage = <2800000 1800000 1104000 1800000 2800000 2800000 0>;
		rgltr-load-current = <300000 600000 1200000 600000 300000 300000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk2_active
			&cam_sensor_active_rst1>;
		pinctrl-1 = <&cam_sensor_mclk2_suspend
			&cam_sensor_suspend_rst1>;
		gpios = <&tlmm 102 0>,
			<&tlmm 117 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK2",
					"CAM_RESET1";
		cci-master = <CCI_MASTER_0>;
		clocks = <&camcc CAM_CC_MCLK2_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

	actuator_triple_uw: qcom,actuator1 {
		cell-index = <1>;
		compatible = "qcom,actuator";
		cci-master = <CCI_MASTER_1>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L6N>;
		regulator-names = "cam_vio", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2800000>;
		rgltr-max-voltage = <1800000 2800000>;
		rgltr-load-current = <600000 300000>;
		status = "ok";
	};

	eeprom_uw: qcom,eeprom1 {
		cell-index = <1>;
		compatible = "qcom,eeprom";
		cam_vio-supply = <&L5N>;
		cam_vdig-supply = <&L1N>;
		cam_vana-supply = <&L3N>;
		cam_v_custom1-supply = <&camera_vdig_aux_ldo>;
		cam_vaf-supply = <&L6N>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vio", "cam_vana", "cam_v_custom1", "cam_vaf",
			"cam_vdig", "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2904000 1824000 2800000 1104000 0>;
		rgltr-max-voltage = <1800000 2904000 1824000 2800000 1104000 0>;
		rgltr-load-current = <600000 300000 400000 300000 1200000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk1_active
				 &cam_sensor_active_rst2>;
		pinctrl-1 = <&cam_sensor_mclk1_suspend
				 &cam_sensor_suspend_rst2>;
		gpios = <&tlmm 101 0>,
			<&tlmm 118 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK1",
					"CAM_RESET2";
		cci-master = <CCI_MASTER_1>;
		clocks = <&camcc CAM_CC_MCLK1_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

    //wide camera
	qcom,cam-sensor1 {
		cell-index = <1>;
		compatible = "qcom,cam-sensor";
		csiphy-sd-index = <1>;
		sensor-position-roll = <90>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <180>;
		eeprom-src = <&eeprom_uw>;
		actuator-src = <&actuator_triple_uw>;
		led-flash-src = <&led_flash_triple_rear_ultrawide>;
		cam_vio-supply = <&L5N>;
		cam_vdig-supply = <&L1N>;
		cam_vana-supply = <&L3N>;
		cam_v_custom1-supply = <&camera_vdig_aux_ldo>;
		cam_vaf-supply = <&L6N>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vio", "cam_vana", "cam_v_custom1", "cam_vaf",
			"cam_vdig", "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2904000 1824000 2800000 1104000 0>;
		rgltr-max-voltage = <1800000 2904000 1824000 2800000 1104000 0>;
		rgltr-load-current = <600000 300000 400000 300000 1200000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk1_active
				 &cam_sensor_active_rst2>;
		pinctrl-1 = <&cam_sensor_mclk1_suspend
				 &cam_sensor_suspend_rst2>;
		gpios = <&tlmm 101 0>,
			<&tlmm 118 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK1",
					"CAM_RESET2";
		cci-master = <CCI_MASTER_1>;
		clocks = <&camcc CAM_CC_MCLK1_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

};

&cam_cci1 {
	actuator_triple_tele: qcom,actuator2{
		cell-index = <2>;
		compatible = "qcom,actuator";
		cci-master = <CCI_MASTER_0>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L7M>;
		regulator-names = "cam_vio", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1800000 2800000>;
		rgltr-max-voltage = <1800000 2800000>;
		rgltr-load-current = <600000 600000>;
		status = "ok";
	};
	eeprom_tele: qcom,eeprom2 {
		cell-index = <2>;
		compatible = "qcom,eeprom";
		cam_vana-supply = <&L7N>;
		cam_vdig-supply = <&L2M>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L7M>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_vdig", "cam_vio", "cam_vaf",
		                  "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2904000 816000 1800000 2800000 0>;
		rgltr-max-voltage = <2904000 816000 1800000 2800000 0>;
		rgltr-load-current = <300000 1200000 600000 600000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk0_active
				 &cam_sensor_active_rst3>;
		pinctrl-1 = <&cam_sensor_mclk0_suspend
				 &cam_sensor_suspend_rst3>;
		gpios = <&tlmm 100 0>,
			<&tlmm 119 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK0",
					"CAM_RESET3";
		cci-master = <CCI_MASTER_0>;
		clocks = <&camcc CAM_CC_MCLK0_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

	qcom,cam-sensor2 {
		cell-index = <2>;
		compatible = "qcom,cam-sensor";
		csiphy-sd-index = <3>;
		sensor-position-roll = <90>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <180>;
		eeprom-src = <&eeprom_tele>;
		actuator-src = <&actuator_triple_tele>;
		led-flash-src = <&led_flash_triple_rear_tele>;
		cam_vana-supply = <&L7N>;
		cam_vdig-supply = <&L2M>;
		cam_vio-supply = <&L5N>;
		cam_vaf-supply = <&L7M>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_vdig", "cam_vio", "cam_vaf",
		                  "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2904000 816000 1800000 2800000 0>;
		rgltr-max-voltage = <2904000 816000 1800000 2800000 0>;
		rgltr-load-current = <300000 1200000 600000 600000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk0_active
				 &cam_sensor_active_rst3>;
		pinctrl-1 = <&cam_sensor_mclk0_suspend
				 &cam_sensor_suspend_rst3>;
		gpios = <&tlmm 100 0>,
			<&tlmm 119 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK0",
					"CAM_RESET3";
		cci-master = <CCI_MASTER_0>;
		clocks = <&camcc CAM_CC_MCLK0_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

	eeprom_aon_front: qcom,eeprom3 {
		cell-index = <3>;
		compatible = "qcom,eeprom";
		cam_vana-supply = <&L4N>;
		cam_vdig-supply = <&L2N>;
		cam_vio-supply = <&L5N>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_vdig", "cam_vio", "cam_clk";
		rgltr-cntrl-support;
		aon-user;
		rgltr-min-voltage = <2800000 1056000 1800000 0>;
		rgltr-max-voltage = <2800000 1056000 1800000 0>;
		rgltr-load-current = <300000 1200000 600000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk4_active
				 &cam_sensor_active_rst4>;
		pinctrl-1 = <&cam_sensor_mclk4_suspend
				 &cam_sensor_suspend_rst4>;
		gpios = <&tlmm 104 0>,
			<&tlmm 120 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK4",
					"CAM_RESET4";
		cci-master = <CCI_MASTER_1>;
		clocks = <&camcc CAM_CC_MCLK4_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};

	qcom,cam-sensor3 {
		cell-index = <3>;
		compatible = "qcom,cam-sensor";
		csiphy-sd-index = <4>;
		sensor-position-roll = <270>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <180>;
		eeprom-src = <&eeprom_aon_front>;
		cam_vana-supply = <&L4N>;
		cam_vdig-supply = <&L2N>;
		cam_vio-supply = <&L5N>;
		cam_clk-supply = <&cam_cc_titan_top_gdsc>;
		regulator-names = "cam_vana", "cam_vdig", "cam_vio", "cam_clk";
		rgltr-cntrl-support;
		aon-user;
		rgltr-min-voltage = <2800000 1056000 1800000 0>;
		rgltr-max-voltage = <2800000 1056000 1800000 0>;
		rgltr-load-current = <300000 1200000 600000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk4_active
				 &cam_sensor_active_rst4>;
		pinctrl-1 = <&cam_sensor_mclk4_suspend
				 &cam_sensor_suspend_rst4>;
		gpios = <&tlmm 104 0>,
			<&tlmm 120 0>;
		gpio-reset = <1>;
		gpio-req-tbl-num = <0 1>;
		gpio-req-tbl-flags = <1 0>;
		gpio-req-tbl-label = "CAMIF_MCLK4",
					"CAM_RESET4";
		cci-master = <CCI_MASTER_1>;
		clocks = <&camcc CAM_CC_MCLK4_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "nominal";
		clock-rates = <19200000>;
		status = "ok";
	};
};

&pm8550vs_c_gpios {
	cam_sensor_vdig_aux_default: cam_sensor_vdig_aux_default {
		pins = "gpio4";
		function = "normal";
		input-disable;
		output-low;
		power-source = <1>; /* 1.8V */
		qcom,drive-strength = <2>;
	};
};
