Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3914675 authored by Jishnu Prakash's avatar Jishnu Prakash Committed by Gerrit - the friendly Code Review server
Browse files

ARM: dts: msm: Add VADC and ADC_TM nodes for lagoon

Add VADC and ADC_TM nodes with channels for PM7250b, PM6150l
and PMK8350 on lagoon. Add corresponding thermal zones for
thermistor channels exposed.

Change-Id: Iab063f5750a96dc2f042c5688d6e132c71781a8b
parent cbda20da
Loading
Loading
Loading
Loading
+135 −0
Original line number Diff line number Diff line
@@ -963,6 +963,141 @@
		};
	};

	chg-skin-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm7250b_adc_tm ADC_AMUX_THM1_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	conn-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm7250b_adc_tm ADC_AMUX_THM3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	sdm-skin-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm ADC_AMUX_THM2_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	rfc-cam-pa3-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm_iio ADC_GPIO2_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	camera-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm ADC_GPIO3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	quiet-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm_iio ADC_GPIO4_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	pa-therm0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm ADC_AMUX_THM3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	pa-therm1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm ADC_AMUX_THM1_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	xo-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PMK8350_ADC7_AMUX_THM1_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	npu-step {
		polling-delay-passive = <10>;
		polling-delay = <0>;
+197 −0
Original line number Diff line number Diff line
@@ -2779,3 +2779,200 @@
};
#include "lagoon-bus.dtsi"
#include "lagoon-thermal.dtsi"

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

	charger_skin_therm {
		reg = <ADC_AMUX_THM1_PU2>;
		label = "charger_skin_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	conn_therm {
		reg = <ADC_AMUX_THM3_PU2>;
		label = "conn_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};
};

&pm7250b_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;
	io-channels = <&pm7250b_vadc ADC_AMUX_THM1_PU2>,
			<&pm7250b_vadc ADC_AMUX_THM3_PU2>;

	/* Channel nodes */
	charger_skin_therm {
		reg = <ADC_AMUX_THM1_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	conn_therm {
		reg = <ADC_AMUX_THM3_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&pm6150l_vadc {
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <
			&rfc_cam_therm_default
			&rear_cam_flash_therm_default
			&quiet_therm_default
	>;

	pa_therm2 {
		reg = <ADC_AMUX_THM1_PU2>;
		label = "pa_therm2";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	msm_therm {
		reg = <ADC_AMUX_THM2_PU2>;
		label = "msm_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pa_therm1 {
		reg = <ADC_AMUX_THM3_PU2>;
		label = "pa_therm1";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	rfc_cam_therm {
		reg = <ADC_GPIO2_PU2>;
		label = "_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	rear_cam_flash_therm {
		reg = <ADC_GPIO3_PU2>;
		label = "_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	quiet_therm {
		reg = <ADC_GPIO4_PU2>;
		label = "_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};
};

&pm6150l_gpios {
	rfc_cam_therm {
		rfc_cam_therm_default: rfc_cam_therm_default {
			pins = "gpio6";
			bias-high-impedance;
		};
	};

	rear_cam_flash_therm {
		rear_cam_flash_therm_default: rear_cam_flash_therm_default {
			pins = "gpio7";
			bias-high-impedance;
		};
	};

	quiet_therm {
		quiet_therm_default: quiet_therm_default {
			pins = "gpio10";
			bias-high-impedance;
		};
	};
};

&pm6150l_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;
	io-channels = <&pm6150l_vadc ADC_AMUX_THM1_PU2>,
			<&pm6150l_vadc ADC_AMUX_THM2_PU2>,
			<&pm6150l_vadc ADC_AMUX_THM3_PU2>,
			<&pm6150l_vadc ADC_GPIO3_PU2>;

	/* Channel nodes */

	pa_therm1 {
		reg = <ADC_AMUX_THM1_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	msm_therm {
		reg = <ADC_AMUX_THM2_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pa_therm0 {
		reg = <ADC_AMUX_THM3_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	rear_cam_flash_therm {
		reg = <ADC_GPIO3_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&pmk8350_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;
	io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;

	xo_therm {
		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&spmi_bus {
	qcom,pm6150l@4 {
		pm6150l_adc_tm_iio: adc_tm@3400 {
			compatible = "qcom,adc-tm5-iio";
			reg = <0x3400 0x100>;
			#thermal-sensor-cells = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			io-channels = <&pm6150l_vadc ADC_GPIO2_PU2>,
					<&pm6150l_vadc ADC_GPIO4_PU2>;

			rfc_cam_therm {
				reg = <ADC_GPIO2_PU2>;
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
			};

			quiet_therm {
				reg = <ADC_GPIO4_PU2>;
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
			};
		};
	};
};
+52 −0
Original line number Diff line number Diff line
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

#define PMK8350_SID	6

#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>

&spmi_bus {
	#address-cells = <2>;
	#size-cells = <0>;
@@ -18,6 +22,54 @@
			reg = <0x100 0x100>;
		};

		pmk8350_vadc: vadc@3100 {
			compatible = "qcom,spmi-adc7";
			reg = <0x3100 0x100>;
			#address-cells = <1>;
			#size-cells = <0>;
			interrupts = <0x6 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "eoc-int-en-set";
			#io-channel-cells = <1>;
			io-channel-ranges;

			/* Channel nodes */
			ref_gnd {
				reg = <PMK8350_ADC7_REF_GND>;
				label = "ref_gnd";
				qcom,pre-scaling = <1 1>;
			};

			vref_1p25 {
				reg = <PMK8350_ADC7_1P25VREF>;
				label = "vref_1p25";
				qcom,pre-scaling = <1 1>;
			};

			die_temp {
				reg = <PMK8350_ADC7_DIE_TEMP>;
				label = "die_temp";
				qcom,pre-scaling = <1 1>;
			};

			xo_therm {
				reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
				label = "xo_therm";
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
				qcom,pre-scaling = <1 1>;
			};
		};

		pmk8350_adc_tm: adc_tm@3400 {
			compatible = "qcom,adc-tm7";
			reg = <0x3400>;
			interrupts = <0x6 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "thr-int-en";
			#address-cells = <1>;
			#size-cells = <0>;
			#thermal-sensor-cells = <1>;
		};

		pmk8350_rtc: rtc@6100 {
			compatible = "qcom,pmk8350-rtc";
			reg = <0x6100>, <0x6200>;