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

Commit 14ebbe1d authored by Jishnu Prakash's avatar Jishnu Prakash
Browse files

ARM: dts: msm: Add ADC thermistor support for trinket.



Add ADC_TM nodes and user thermal zone entries for
thermistor channels on PM6125 and PMI632 for trinket.

In addition, make bat_id use ratiometric calibration
for PMI632.

Change-Id: I7ccb42efa23a1f49c8a844d411f4094fe531ee66
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent 405fe317
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -123,6 +123,8 @@
			bat_id {
				reg = <ADC_BAT_ID_PU2>;
				label = "bat_id";
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
				qcom,pre-scaling = <1 1>;
			};

+114 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * 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 <dt-bindings/thermal/thermal.h>

&thermal_zones {
	rf-pa0-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6125_adc_tm ADC_AMUX_THM1_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	quiet-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6125_adc_tm ADC_AMUX_THM2_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

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

	rf-pa1-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6125_adc_tm ADC_GPIO4_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	conn-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmi632_adc_tm ADC_GPIO1_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	skin-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmi632_adc_tm ADC_GPIO2_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	emmc-ufs-therm-adc {
		polling-delay-passive = <0>;
		polling-delay = <5000>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6125_adc_tm_iio ADC_GPIO1_PU2>;
	};

	camera-ftherm-adc {
		polling-delay-passive = <0>;
		polling-delay = <5000>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6125_adc_tm_iio ADC_GPIO3_PU2>;
	};
};
+25 −0
Original line number Diff line number Diff line
@@ -1572,6 +1572,30 @@

};

&spmi_bus {
	qcom,pm6125@0 {
		pm6125_adc_tm_iio: adc_tm@3400 {
			compatible = "qcom,adc-tm5-iio";
			reg = <0x3400 0x100>;
			#thermal-sensor-cells = <1>;
			io-channels = <&pm6125_vadc ADC_GPIO1_PU2>,
					<&pm6125_vadc ADC_GPIO3_PU2>;

			emmc_ufs_therm {
				reg = <ADC_GPIO1_PU2>;
				qcom,ratiometric;
				qcom,hw-settle-time = <200>;
			};

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

&pm6125_adc_tm {
	io-channels = <&pm6125_vadc ADC_AMUX_THM1_PU2>,
			<&pm6125_vadc ADC_AMUX_THM2_PU2>,
@@ -1699,3 +1723,4 @@
&usb0 {
	extcon = <&pmi632_charger>;
};
#include "trinket-thermal.dtsi"