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

Commit d032791e 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 support for atoll



Add VADC and ADC_TM nodes with channels and user thermal_zone
entries for PM6150 and PM6150l for atoll.

Change-Id: Ic06d38ca0adf7a7e3610e0ce19f47f165e3b5cdb
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent 74939878
Loading
Loading
Loading
Loading
+91 −0
Original line number Diff line number Diff line
@@ -12,3 +12,94 @@

&soc {
};

&pm6150l_vadc {
	pinctrl-0 = <&camera_flash_therm_default &tof_therm_default>;

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

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

&pm6150l_gpios {
	tof_therm {
		tof_therm_default: tof_therm_default {
			pins = "gpio7";
			bias-high-impedance;
		};
	};
};

&pm6150l_adc_tm {
	io-channels = <&pm6150l_vadc ADC_AMUX_THM1_PU2>,
			<&pm6150l_vadc ADC_AMUX_THM2_PU2>,
			<&pm6150l_vadc ADC_AMUX_THM3_PU2>,
			<&pm6150l_vadc ADC_GPIO1_PU2>;

	pa_therm1 {
		reg = <ADC_AMUX_THM3_PU2>;
		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>;
			io-channels = <&pm6150l_vadc ADC_GPIO3_PU2>;

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

&thermal_zones {
	pa-therm1 {
		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";
			};
		};
	};

	tof-therm {
		polling-delay-passive = <0>;
		polling-delay = <5000>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150l_adc_tm_iio ADC_GPIO3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};
+121 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019, 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 {
	xo-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150_adc_tm ADC_XO_THERM_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

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

	nvm-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm6150_adc_tm ADC_GPIO1_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 = <&pm6150_adc_tm ADC_GPIO2_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 ADC_AMUX_THM1_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_THM2_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_GPIO1_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};
+150 −0
Original line number Diff line number Diff line
@@ -1754,3 +1754,153 @@
#include "atoll-coresight.dtsi"
#include "atoll-stub-regulator.dtsi"
#include "atoll-usb.dtsi"

&pm6150_vadc {
	pinctrl-names = "default";
	pinctrl-0 = <&nvm_therm_default &sdm_skin_therm_default>;

	chg_skin_therm {
		reg = <ADC_AMUX_THM1_PU2>;
		label = "chg_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>;
	};

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

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

&pm6150_gpios {
	nvm_therm {
		nvm_therm_default: nvm_therm_default {
			pins = "gpio1";
			bias-high-impedance;
		};
	};

	sdm_skin_therm {
		sdm_skin_therm_default: sdm_skin_therm_default {
			pins = "gpio8";
			bias-high-impedance;
		};
	};
};

&pm6150_adc_tm {
	io-channels = <&pm6150_vadc ADC_XO_THERM_PU2>,
			<&pm6150_vadc ADC_AMUX_THM1_PU2>,
			<&pm6150_vadc ADC_GPIO1_PU2>,
			<&pm6150_vadc ADC_GPIO2_PU2>;

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

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

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

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

&pm6150l_vadc {
	pinctrl-names = "default";
	pinctrl-0 = <&camera_flash_therm_default>;

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

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

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

&pm6150l_gpios {
	camera_flash_therm {
		camera_flash_therm_default: camera_flash_therm_default {
			pins = "gpio5";
			bias-high-impedance;
		};
	};
};

&pm6150l_adc_tm {
	io-channels = <&pm6150l_vadc ADC_AMUX_THM1_PU2>,
			<&pm6150l_vadc ADC_AMUX_THM2_PU2>,
			<&pm6150l_vadc ADC_GPIO1_PU2>;

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

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

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

#include "atoll-thermal.dtsi"