/* Waipio configurations for PM8010I and PM8010J connected via SPMI */

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator-levels.h>
#include <dt-bindings/spmi/spmi.h>

/ {
	qcom,pmic-id = <0x2f 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x41 0x41>;
	qcom,pmic-id-size = <10>;
};

&apps_rsc {
	rpmh-regulator-ldoi2 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoi2";
		qcom,regulator-type = "pmic5-ldo";
		qcom,supported-modes =
			<RPMH_REGULATOR_MODE_LPM
			 RPMH_REGULATOR_MODE_HPM>;
		qcom,mode-threshold-currents = <0 30000>;
		L2I: pm8010i_l2: regulator-pm8010i-l2 {
			regulator-name = "pm8010i_l2";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <1056000>;
			regulator-max-microvolt = <1056000>;
			qcom,init-voltage = <1056000>;
			qcom,init-mode = <RPMH_REGULATOR_MODE_HPM>;
		};
	};

	rpmh-regulator-ldoi3 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoi3";
		qcom,regulator-type = "pmic5-ldo";
		L3I: pm8010i_l3: regulator-pm8010i-l3 {
			regulator-name = "pm8010i_l3";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2904000>;
			regulator-max-microvolt = <2904000>;
			qcom,init-voltage = <2904000>;
		};
	};

	rpmh-regulator-ldoi4 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoi4";
		qcom,regulator-type = "pmic5-ldo";
		L4I: pm8010i_l4: regulator-pm8010i-l4 {
			regulator-name = "pm8010i_l4";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			qcom,init-voltage = <2800000>;
		};
	};

	rpmh-regulator-ldoi6 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoi6";
		qcom,regulator-type = "pmic5-ldo";
		L6I: pm8010i_l6: regulator-pm8010i-l6 {
			regulator-name = "pm8010i_l6";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			qcom,init-voltage = <2800000>;
		};
	};

	rpmh-regulator-ldoi7 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoi7";
		qcom,regulator-type = "pmic5-ldo";
		L7I: pm8010i_l7: regulator-pm8010i-l7 {
			regulator-name = "pm8010i_l7";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2960000>;
			regulator-max-microvolt = <2960000>;
			qcom,init-voltage = <2960000>;
		};
	};

	rpmh-regulator-ldoj1 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj1";
		qcom,regulator-type = "pmic5-ldo";
		qcom,supported-modes =
			<RPMH_REGULATOR_MODE_LPM
			 RPMH_REGULATOR_MODE_HPM>;
		qcom,mode-threshold-currents = <0 30000>;
		L1J: pm8010j_l1: regulator-pm8010j-l1 {
			regulator-name = "pm8010j_l1";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <1104000>;
			regulator-max-microvolt = <1104000>;
			qcom,init-voltage = <1104000>;
			qcom,init-mode = <RPMH_REGULATOR_MODE_HPM>;
		};
	};

	rpmh-regulator-ldoj2 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj2";
		qcom,regulator-type = "pmic5-ldo";
		qcom,supported-modes =
			<RPMH_REGULATOR_MODE_LPM
			 RPMH_REGULATOR_MODE_HPM>;
		qcom,mode-threshold-currents = <0 30000>;
		L2J: pm8010j_l2: regulator-pm8010j-l2 {
			regulator-name = "pm8010j_l2";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <1056000>;
			regulator-max-microvolt = <1056000>;
			qcom,init-voltage = <1056000>;
			qcom,init-mode = <RPMH_REGULATOR_MODE_HPM>;
		};
	};

	rpmh-regulator-ldoj3 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj3";
		qcom,regulator-type = "pmic5-ldo";
		L3J: pm8010j_l3: regulator-pm8010j-l3 {
			regulator-name = "pm8010j_l3";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,init-voltage = <1800000>;
		};
	};

	rpmh-regulator-ldoj4 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj4";
		qcom,regulator-type = "pmic5-ldo";
		L4J: pm8010j_l4: regulator-pm8010j-l4 {
			regulator-name = "pm8010j_l4";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,init-voltage = <1800000>;
		};
	};

	rpmh-regulator-ldoj5 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj5";
		qcom,regulator-type = "pmic5-ldo";
		L5J: pm8010j_l5: regulator-pm8010j-l5 {
			regulator-name = "pm8010j_l5";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			qcom,init-voltage = <2800000>;
		};
	};

	rpmh-regulator-ldoj6 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj6";
		qcom,regulator-type = "pmic5-ldo";
		L6J: pm8010j_l6: regulator-pm8010j-l6 {
			regulator-name = "pm8010j_l6";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			qcom,init-voltage = <2800000>;
		};
	};

	rpmh-regulator-ldoj7 {
		compatible = "qcom,rpmh-vrm-regulator";
		qcom,resource-name = "ldoj7";
		qcom,regulator-type = "pmic5-ldo";
		L7J: pm8010j_l7: regulator-pm8010j-l7 {
			regulator-name = "pm8010j_l7";
			qcom,set = <RPMH_REGULATOR_SET_ALL>;
			regulator-min-microvolt = <3304000>;
			regulator-max-microvolt = <3304000>;
			qcom,init-voltage = <3304000>;
		};
	};
};

&spmi_bus {
	#address-cells = <2>;
	#size-cells = <0>;
	interrupt-controller;
	#interrupt-cells = <4>;

	qcom,pm8010@8 {
		compatible = "qcom,spmi-pmic";
		reg = <8 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pm8010i_tz: qcom,temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <0x8 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
			#thermal-sensor-cells = <0>;
		};
	};

	qcom,pm8010@9 {
		compatible = "qcom,spmi-pmic";
		reg = <9 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pm8010j_tz: qcom,temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <0x9 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
			#thermal-sensor-cells = <0>;
		};
	};
};

&thermal_zones {
	pm8010i_tz {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8010i_tz>;

		trips {
			trip0 {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};

			trip1 {
				temperature = <115000>;
				hysteresis = <0>;
				type = "passive";
			};

			trip2 {
				temperature = <145000>;
				hysteresis = <0>;
				type = "passive";
			};
		};
	};

	pm8010j_tz {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8010j_tz>;

		trips {
			trip0 {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};

			trip1 {
				temperature = <115000>;
				hysteresis = <0>;
				type = "passive";
			};

			trip2 {
				temperature = <145000>;
				hysteresis = <0>;
				type = "passive";
			};
		};
	};
};
