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

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

ARM: dts: msm: Add VADC support for scuba

Add VADC main node with ADC channel nodes on PM2250 for scuba.
Add ADC_TM_IIO node for exposing thermistor channels and
corresponding thermal zones.

Change-Id: I42c89a112cb32956ec682a4adb1ad37b465615e3
parent c473cad8
Loading
Loading
Loading
Loading
+90 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#include <dt-bindings/input/qcom,qpnp-power-on.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>
#include <dt-bindings/iio/qcom,spmi-vadc.h>

&spmi_bus {
	#address-cells = <2>;
@@ -52,7 +53,95 @@
			qcom,temperature-threshold-set = <1>;
		};

		pmi2250_gpios: pinctrl@c000 {
		pm2250_vadc: vadc@3100 {
			compatible = "qcom,spmi-adc5-lite";
			reg = <0x3100 0x100>;
			reg-names = "adc5-usr-base";
			#address-cells = <1>;
			#size-cells = <0>;
			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "eoc-int-en-set";
			#io-channel-cells = <1>;
			io-channel-ranges;

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

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

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

			vph_pwr {
				reg = <ADC_VPH_PWR>;
				label = "vph_pwr";
				qcom,pre-scaling = <1 3>;
			};

			vbat_sns {
				reg = <ADC_VBAT_SNS>;
				label = "vbat_sns";
				qcom,pre-scaling = <1 3>;
			};

			usb_in_v_div_16 {
				reg = <ADC_USB_IN_V_16>;
				label = "usb_in_v_div_16";
				qcom,pre-scaling = <1 16>;
			};

			chg_temp {
				reg = <ADC_CHG_TEMP>;
				label = "chg_temp";
				qcom,pre-scaling = <1 1>;
			};

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

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

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

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


		pm2250_gpios: pinctrl@c000 {
			compatible = "qcom,spmi-gpio";
			reg = <0xc000 0xa00>;
			interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>,
+75 −0
Original line number Diff line number Diff line
@@ -189,5 +189,80 @@
			};
		};
	};

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

	pa-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm2250_adc_tm_iio ADC_AMUX_THM1_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 = <&pm2250_adc_tm_iio ADC_AMUX_THM2_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

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

	skin-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm2250_adc_tm_iio ADC_GPIO3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};
+104 −0
Original line number Diff line number Diff line
@@ -1221,6 +1221,7 @@
	};
};

#include "pm2250.dtsi"
#include "scuba-thermal.dtsi"
#include "scuba-coresight.dtsi"
#include "scuba-pinctrl.dtsi"
@@ -1231,6 +1232,109 @@
#include "scuba-usb.dtsi"
#include "msm-arm-smmu-scuba.dtsi"

&pm2250_vadc {
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&skin_therm_default>;

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

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

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

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

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

&pm2250_gpios {
	skin_therm {
		skin_therm_default: skin_therm_default {
			pins = "gpio5";
			bias-high-impedance;
		};
	};
};

&spmi_bus {
	qcom,pm2250@0 {
		pm2250_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 = <&pm2250_vadc ADC_XO_THERM_PU2>,
					<&pm2250_vadc ADC_AMUX_THM1_PU2>,
					<&pm2250_vadc ADC_AMUX_THM2_PU2>,
					<&pm2250_vadc ADC_AMUX_THM3_PU2>,
					<&pm2250_vadc ADC_GPIO3_PU2>;

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

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

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

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

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

&gcc_camss_top_gdsc {
	status = "ok";
};