From c610afaa21d3c6e7b02040c8563ffc01c7fc0570 Mon Sep 17 00:00:00 2001 From: "Ivan T. Ivanov" Date: Thu, 5 Feb 2015 19:12:56 +0200 Subject: thermal: Add QPNP PMIC temperature alarm driver Add support for the temperature alarm peripheral found inside Qualcomm plug-and-play (QPNP) PMIC chips. The temperature alarm peripheral outputs a pulse on an interrupt line whenever the thermal over temperature stage value changes. Register a thermal sensor. The temperature reported by this thermal sensor device should reflect the actual PMIC die temperature if an ADC is present on the given PMIC. If no ADC is present, then the reported temperature should be estimated from the over temperature stage value. Cc: David Collins Signed-off-by: Ivan T. Ivanov Signed-off-by: Eduardo Valentin --- drivers/thermal/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/thermal/Kconfig') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index af40db0df58e..30aee81e9f5b 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -299,4 +299,15 @@ depends on ARCH_STI && OF source "drivers/thermal/st/Kconfig" endmenu +config QCOM_SPMI_TEMP_ALARM + tristate "Qualcomm SPMI PMIC Temperature Alarm" + depends on OF && SPMI && IIO + select REGMAP_SPMI + help + This enables a thermal sysfs driver for Qualcomm plug-and-play (QPNP) + PMIC devices. It shows up in sysfs as a thermal sensor with multiple + trip points. The temperature reported by the thermal sensor reflects the + real time die temperature if an ADC is present or an estimate of the + temperature based upon the over temperature stage value. + endif -- cgit v1.2.3 From 6b775e870c56c59c3e16531ea2307b797395f9f7 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 2 Mar 2015 17:17:19 +0000 Subject: thermal: introduce the Power Allocator governor The power allocator governor is a thermal governor that controls system and device power allocation to control temperature. Conceptually, the implementation divides the sustainable power of a thermal zone among all the heat sources in that zone. This governor relies on "power actors", entities that represent heat sources. They can report current and maximum power consumption and can set a given maximum power consumption, usually via a cooling device. The governor uses a Proportional Integral Derivative (PID) controller driven by the temperature of the thermal zone. The output of the controller is a power budget that is then allocated to each power actor that can have bearing on the temperature we are trying to control. It decides how much power to give each cooling device based on the performance they are requesting. The PID controller ensures that the total power budget does not exceed the control temperature. Cc: Zhang Rui Cc: Eduardo Valentin Signed-off-by: Punit Agrawal Signed-off-by: Javi Merino Signed-off-by: Eduardo Valentin --- drivers/thermal/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/thermal/Kconfig') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 30aee81e9f5b..a1b43eab0a70 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -71,6 +71,14 @@ config THERMAL_DEFAULT_GOV_USER_SPACE Select this if you want to let the user space manage the platform thermals. +config THERMAL_DEFAULT_GOV_POWER_ALLOCATOR + bool "power_allocator" + select THERMAL_GOV_POWER_ALLOCATOR + help + Select this if you want to control temperature based on + system and device power allocation. This governor can only + operate on cooling devices that implement the power API. + endchoice config THERMAL_GOV_FAIR_SHARE @@ -99,6 +107,13 @@ config THERMAL_GOV_USER_SPACE help Enable this to let the user space manage the platform thermals. +config THERMAL_GOV_POWER_ALLOCATOR + bool "Power allocator thermal governor" + select THERMAL_POWER_ACTOR + help + Enable this to manage platform thermals by dynamically + allocating and limiting power to devices. + config CPU_THERMAL bool "generic cpu cooling support" depends on CPU_FREQ -- cgit v1.2.3 From 35e946447f22d722e06702f4f040f7b108cafbbe Mon Sep 17 00:00:00 2001 From: Punit Agrawal Date: Tue, 3 Mar 2015 10:43:03 +0000 Subject: thermal: core: Add Kconfig option to enable writable trips Add a Kconfig option to allow system integrators to control whether userspace tools can change trip temperatures. This option overrides the thermal zone setup in the driver code and must be enabled for platform specified writable trips to come into effect. The original behaviour of requiring root privileges to change trip temperatures remains unchanged. Cc: Eduardo Valentin Cc: Zhang Rui Signed-off-by: Punit Agrawal Signed-off-by: Eduardo Valentin --- drivers/thermal/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/thermal/Kconfig') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index a1b43eab0a70..46bdecf260e5 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -42,6 +42,17 @@ config THERMAL_OF Say 'Y' here if you need to build thermal infrastructure based on device tree. +config THERMAL_WRITABLE_TRIPS + bool "Enable writable trip points" + help + This option allows the system integrator to choose whether + trip temperatures can be changed from userspace. The + writable trips need to be specified when setting up the + thermal zone but the choice here takes precedence. + + Say 'Y' here if you would like to allow userspace tools to + change trip temperatures. + choice prompt "Default Thermal governor" default THERMAL_DEFAULT_GOV_STEP_WISE -- cgit v1.2.3 From db6cb88b8f4748589d826930c7626b7cde262243 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Wed, 4 Mar 2015 17:57:29 +0000 Subject: thermal: remove stale THERMAL_POWER_ACTOR select A previous version of this patch had a config for THERMAL_POWER_ACTOR but it was dropped. Remove the select as it is not doing anything. Cc: Zhang Rui Cc: Eduardo Valentin Reported-by: Valentin Rothberg Signed-off-by: Javi Merino Signed-off-by: Eduardo Valentin --- drivers/thermal/Kconfig | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/thermal/Kconfig') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 46bdecf260e5..3379beeed109 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -120,7 +120,6 @@ config THERMAL_GOV_USER_SPACE config THERMAL_GOV_POWER_ALLOCATOR bool "Power allocator thermal governor" - select THERMAL_POWER_ACTOR help Enable this to manage platform thermals by dynamically allocating and limiting power to devices. -- cgit v1.2.3 From 9a5238a9c6c33dd31525f2bba4aa1af4f8374ae1 Mon Sep 17 00:00:00 2001 From: kongxinwei Date: Wed, 20 May 2015 19:16:37 +0800 Subject: thermal: hisilicon: add new hisilicon thermal sensor driver This patch adds the support for hisilicon thermal sensor, within hisilicon SoC. there will register sensors for thermal framework and use device tree to bind cooling device. Signed-off-by: Leo Yan Signed-off-by: kongxinwei Signed-off-by: Eduardo Valentin --- drivers/thermal/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/thermal/Kconfig') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 3379beeed109..80e9c45399c7 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -161,6 +161,14 @@ config THERMAL_EMULATION because userland can easily disable the thermal policy by simply flooding this sysfs node with low temperature values. +config HISI_THERMAL + tristate "Hisilicon thermal driver" + depends on ARCH_HISI && CPU_THERMAL && OF + help + Enable this to plug hisilicon's thermal sensor driver into the Linux + thermal framework. cpufreq is used as the cooling device to throttle + CPUs when the passive trip is crossed. + config IMX_THERMAL tristate "Temperature sensor driver for Freescale i.MX SoCs" depends on CPU_THERMAL -- cgit v1.2.3