Commit 9066073c authored by Rajendra Nayak's avatar Rajendra Nayak Committed by Zhang Rui
Browse files

thermal: qcom: tsens: Add a skeletal TSENS drivers



TSENS is Qualcomms' thermal temperature sensor device. It
supports reading temperatures from multiple thermal sensors
present on various QCOM SoCs.
Calibration data is generally read from a non-volatile memory
(eeprom) device.

Add a skeleton driver with all the necessary abstractions so
a variety of qcom device families which support TSENS can
add driver extensions.

Also add the required device tree bindings which can be used
to describe the TSENS device in DT.

Signed-off-by: default avatarRajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: default avatarLina Iyer <lina.iyer@linaro.org>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent c6935931
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
* QCOM SoC Temperature Sensor (TSENS)

Required properties:
- compatible :
 - "qcom,msm8916-tsens" : For 8916 Family of SoCs
 - "qcom,msm8974-tsens" : For 8974 Family of SoCs
 - "qcom,msm8996-tsens" : For 8996 Family of SoCs

- reg: Address range of the thermal registers
- #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description.
- Refer to Documentation/devicetree/bindings/nvmem/nvmem.txt to know how to specify
nvmem cells

Example:
tsens: thermal-sensor@900000 {
		compatible = "qcom,msm8916-tsens";
		reg = <0x4a8000 0x2000>;
		nvmem-cells = <&tsens_caldata>, <&tsens_calsel>;
		nvmem-cell-names = "caldata", "calsel";
		#thermal-sensor-cells = <1>;
	};
+5 −0
Original line number Diff line number Diff line
@@ -399,4 +399,9 @@ config GENERIC_ADC_THERMAL
	  to this driver. This driver reports the temperature by reading ADC
	  channel and converts it to temperature based on lookup table.

menu "Qualcomm thermal drivers"
depends on (ARCH_QCOM && OF) || COMPILE_TEST
source "drivers/thermal/qcom/Kconfig"
endmenu

endif
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
obj-$(CONFIG_INT340X_THERMAL)  += int340x_thermal/
obj-$(CONFIG_INTEL_PCH_THERMAL)	+= intel_pch_thermal.o
obj-$(CONFIG_ST_THERMAL)	+= st/
obj-$(CONFIG_QCOM_TSENS)	+= qcom/
obj-$(CONFIG_TEGRA_SOCTHERM)	+= tegra/
obj-$(CONFIG_HISI_THERMAL)     += hisi_thermal.o
obj-$(CONFIG_MTK_THERMAL)	+= mtk_thermal.o
+11 −0
Original line number Diff line number Diff line
config QCOM_TSENS
	tristate "Qualcomm TSENS Temperature Alarm"
	depends on THERMAL
	depends on QCOM_QFPROM
	depends on ARCH_QCOM || COMPILE_TEST
	help
	  This enables the thermal sysfs driver for the TSENS device. It shows
	  up in Sysfs as a thermal zone with multiple trip points. Disabling the
	  thermal zone device via the mode file results in disabling the sensor.
	  Also able to set threshold temperature for both hot and cold and update
	  when a threshold is reached.
+2 −0
Original line number Diff line number Diff line
obj-$(CONFIG_QCOM_TSENS)	+= qcom_tsens.o
qcom_tsens-y			+= tsens.o tsens-common.o
Loading