summaryrefslogtreecommitdiff
path: root/drivers/thermal
AgeCommit message (Collapse)Author
2018-02-26thermal: add boundary check to set_cur_stateSrikar Srimath Tirumala
Prevent sysfs from setting a cur_state that exceeds the max cur_state of the cooling device. Bug 200334223 Bug 200331706 Bug 1968660 Bug 1968616 Change-Id: I935be6166a9e184683abfcdce70cb08cbe4a1350 Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1558407 (cherry picked from commit 142cf9d96ed221124ea2b778dc37cf5db8d5702c) Reviewed-on: https://git-master.nvidia.com/r/1661413 Reviewed-on: https://git-master.nvidia.com/r/1662626 GVS: Gerrit_Virtual_Submit Tested-by: Amulya Yarlagadda <ayarlagadda@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
2014-06-27thermal: check return value of update_temperatureJinyoung Park
Checking return value of update_temperature. If return value is not Zero, it does't handle thermal trips. Bug 200011588 Bug 200015248 Change-Id: I084e7c53ee132b33fa377d96f6c9e70f26529ffe Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/428636 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> GVS: Gerrit_Virtual_Submit
2014-06-23thermal: check tz device is registeredJinyoung Park
Checking thermal zone device whether it is registered or not. Bug 200011588 Change-Id: I377583f887d3dbe8258daa46d777daa6337b192f Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/424088 Reviewed-by: Seema Khowala <seemaj@nvidia.com> Tested-by: Seema Khowala <seemaj@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> GVS: Gerrit_Virtual_Submit
2014-06-13thermal: remove all unsigned type use for temperatureDiwakar Tundlam
Bug 1516918 Change-Id: I5615b0657d255d9134415d92d372771baa4271e1 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/420818 GVS: Gerrit_Virtual_Submit Reviewed-by: Josh Kuo <joshk@nvidia.com> Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com>
2014-06-05thermal: palmas: handle hotdie alert via thermal cdevDiwakar Tundlam
Do not treat hotdie alert as a critical event. Bind a cdev to the hotdie temp alert IRQ and handle it via thermal framework to throttle clocks to desired levels. Bug 1506324 Change-Id: I3ec0166ca579798fd8422826d46aa369c4497571 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/417343 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2014-05-29thermal: generic-adc-thermal: Add shutdown callbackJinyoung Park
Added shutdown callback function to prevent unwanted thermal zone operating while shutdown processing. Bug 1515432 Change-Id: I54822fa6fe4a1af811b11324c5c378904c11f654 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/416247 Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-05-05thermal: palmas: support for DTLaxman Dewangan
Add DT support for the palams thermal driver to initantiate driver from DT. The driver will be registered as: palmas: tps65913 { ::::::::: thermal { compatible = "ti,palmas-thermal"; interrupt-parent = <&palmas>; interrupts = <5 0>; ti,tz-name = "palmas-thermal"; ti,hot-die-threshold-temp = <120000>; }; :::: }; Change-Id: I50266ba3c785985c9016a86dff55929c6dd641e5 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/400356 Reviewed-on: http://git-master/r/405010 GVS: Gerrit_Virtual_Submit
2014-05-05thermal: palmas: no need to free devm_ memory on removeLaxman Dewangan
It is not required to free the memory which is allocated using devm_. The device framework take care or releasing the memory. Change-Id: I40d4815d4ae1385ad3715421b505bec227e3d1b1 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/400355 Reviewed-on: http://git-master/r/405009 GVS: Gerrit_Virtual_Submit
2014-05-05thermal: palmas: use module_platform_driver to reduce boiler plate codeLaxman Dewangan
Use macro module_platform_driver to reduce boiler plate code. This register drivers as platform driver. Change-Id: I00e998bb8de78746bd46bb7ec764e982a0fb1f1e Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/400354 Reviewed-on: http://git-master/r/405008 GVS: Gerrit_Virtual_Submit
2014-03-20Revert "thermal: core: use cancel delayed work sync"Diwakar Tundlam
This reverts commit 918fa5def9fb9ec2ba608c95e06299debd2d9d89. The reverted commit seems to cause this new bug noted below. Bug 1478989 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Change-Id: Icf937aab9089ea68f397b25cf40fa2494e31686a Reviewed-on: http://git-master/r/381789 Reviewed-by: Seema Khowala <seemaj@nvidia.com> Tested-by: Seema Khowala <seemaj@nvidia.com>
2014-03-10thermal: core: use cancel delayed work syncDiwakar Tundlam
This fixes an issue with race between a piece of delayed work in progress and its cancellation during sensor shutdown that happens as part of system power-down. We refactor the code a bit to make sure the cancel_sync is called outside the tz mutex to prevent deadlock. This was found during a stress test by continuously running warm-reboot in a loop. We found that eventually, we get a system hang or crash with an error message from a failed reading of the temp from the get_temp API which indicates a potential issue with the polling work function. We can accelerate the reproduction of the issue by introducing an artificial delay in the work function and forcing polling by setting a non-zero polling_delay for the thermal zone. In the actual system, the timing differences could be introduced from other unresolved errors in the I2C bus transactions which could show up during the cold and warm reboot stress tests. Bug 1463497 Change-Id: I58b8a90052850b0d67d531200d90ed2dc168e48c Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Cc: Paul Walmsley <pwalmsley@nvidia.com> Cc: Seema Khowala <seemaj@nvidia.com> Reviewed-on: http://git-master/r/378692 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Seema Khowala <seemaj@nvidia.com> Tested-by: Seema Khowala <seemaj@nvidia.com>
2014-03-04thermal: generic-adc-thermal: Add debugfs nodesJinyoung Park
Added debugfs nodes for iio_channel_name, tz_name and raw_adc. Bug 1398960 Bug 1415280 Change-Id: I00c84c1b282aff4e7c5dee7c8e4fdb172584b0ce Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> (cherry picked from commit 0d45f672727644614d721fa465cf70bd95934577) Reviewed-on: http://git-master/r/361408 Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com> Tested-by: Anshul Jain (SW) <anshulj@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2014-02-27thermal: cpu_cooling: introduce of_cpufreq_cooling_registerEduardo Valentin
This patch introduces an API to register cpufreq cooling device based on device tree node. The registration via device tree node differs from normal registration due to the fact that it is needed to fill the device_node structure in order to be able to match the cooling devices with trip points. Change-Id: Id865a777268b442709f0a7a268563df727c17d79 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Signed-off-by: Christina Guertin <cguertin@nvidia.com> Reviewed-on: http://git-master/r/356896 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-27thermal: core: introduce thermal_of_cooling_device_registerEduardo Valentin
This patch adds a new API to allow registering cooling devices in the thermal framework derived from device tree nodes. This API links the cooling device with the device tree node so that binding with thermal zones is possible, given that thermal zones are pointing to cooling device device tree nodes. Change-Id: Ieba6a5a6ea204cd7a71e767301d3ce510c7aba46 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Signed-off-by: Christina Guertin <cguertin@nvidia.com> Reviewed-on: http://git-master/r/356895 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-27thermal: introduce device tree parserEduardo Valentin
This patch introduces a device tree bindings for describing the hardware thermal behavior and limits. Also a parser to read and interpret the data and feed it in the thermal framework is presented. This patch introduces a thermal data parser for device tree. The parsed data is used to build thermal zones and thermal binding parameters. The output data can then be used to deploy thermal policies. This patch adds also documentation regarding this API and how to define tree nodes to use this infrastructure. Note that, in order to be able to have control on the sensor registration on the DT thermal zone, it was required to allow changing the thermal zone .get_temp callback. For this reason, this patch also removes the 'const' modifier from the .ops field of thermal zone devices. Change-Id: I5f6150963b24b702b230746f669ebaaac507cac5 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Signed-off-by: Christina Guertin <cguertin@nvidia.com> Reviewed-on: http://git-master/r/356894 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-25thermal: generic_adc_thermal: Support trip pointsJinyoung Park
Support trip points on generic adc thermal zones. Bug 1450980 Change-Id: Ie4a8602a83bdada47dd73579d5efe3ccff8728f3 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/367172 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Hyungwoo Yang <hyungwooy@nvidia.com> Tested-by: Hyungwoo Yang <hyungwooy@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-14cpufreq: remove CONFIG_CPU_FREQ_TABLEViresh Kumar
CONFIG_CPU_FREQ_TABLE will be always enabled when cpufreq framework is used, as cpufreq core depends on it. So, we don't need this CONFIG option anymore as it is not configurable. Remove CONFIG_CPU_FREQ_TABLE and update its users. Change-Id: I40db00061a924631f0eb2fc090b9e543d9069605 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356889 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: allow registering without .get_tempEduardo Valentin
This patch changes the thermal core driver to allow registration of thermal zones without the .get_temp callback. The idea behind this change is to allow lazy registration of sensor callbacks. The thermal zone will be disabled whenever the ops does not contain a .get_temp callback. The sysfs interface will be returning -EINVAL on any temperature read operation. Change-Id: I1ff78dc306f24a42ab5f3930992033301cd054d9 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356893 Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: revert downstream "binding problem" patch; replace with upstreamPaul Walmsley
This reverts NVIDIA downstream commit d2ad63cf30463fb24f4cf645b6cc4523ab39fdee, since it's been replaced by the upstream commit a9f2d19ba7be38590c84487359891d45a66b62f4 (thermal: Fix binding problem when there is thermal zone params). In the same patch, we replace it with the upstream commit. This is to attempt to preserve bisectability: "The thermal zone params can be used to set governor to specific thermal governor for thermal zone device. But if the thermal zone params has only governor name without thermal bind params, then the thermal zone device will not be binding to cooling device. Because tz->ops->bind operator is not invoked in bind_tz() and bind_cdev() when there is thermal zone params." Per Wei Ni's request in http://git-master/r/#/c/352493/1 The mainline patch was originally signed off by Wei Ni <wni@nvidia.com>, Jinyoung Park <jinyoungp@nvidia.com>, and Zhang Rui <rui.zhang@intel.com>. This patch is not for submission upstream. Change-Id: I1dad52ee9779c9e53ab27f2dafcbc56bcd91c989 Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> Reviewed-on: http://git-master/r/356892 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: cpu_cooling: fix return value check in cpufreq_cooling_register()Wei Yongjun
In case of error, the function thermal_cooling_device_register() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Change-Id: I9fc197c47184cc8681392b31d4c2fb87bcf8b461 Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356891 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13Revert "drivers: thermal: parent virtual hwmon with thermal zone"Zhang Rui
Commit b82715fdd4a5407f56853b24d387d484dd9c3b5b introduces a 'device' subdirectory under /sys/class/hwmon/hwmonX/ directory, for the thermal_zone hwmon devices. And this results in different handling by libsensors. The problem is reported and discussed in this thread http://marc.info/?l=linux-pm&m=138229306109596&w=2 This patch reverts commit b82715fdd4a5407f56853b24d387d484dd9c3b5b. Change-Id: Id7c99beeb92c1b779a280cba1874fd19d0931751 Reported-by: Arnaud Ebalard <arno@natisbad.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356890 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13Thermal: Check for validity before doing kfreeDurgadoss R
The thermal_release function is called whenever any device belonging to 'thermal' class unregisters. This function performs kfree(cdev) without any check. In cases where there are more device registrations other than just 'thermal_zone' and 'cooling_device' this might accidently free memory allocated them silently; and cause memory errors. This patch changes this behavior by doing kfree(cdev) only when the device pointer belongs to a real cdev i.e. cooling_device. Change-Id: I1c06dfcf3a104ad08e9c78a00233a53df17dbea7 Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356888 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: Kconfig: cosmetic fixesLuka Perkov
Fix typo, finish sentence and add missing dots. Change-Id: Idb3931c87eb9573b5ecc77922817a5c312cc37c5 Signed-off-by: Luka Perkov <luka@openwrt.org> CC: Randy Dunlap <rdunlap@infradead.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356887 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13typo in drivers/thermal/Kconfig: lpatform instead of platformRegid Ichira
Applied to the HEAD of linux.git, VERSION = 3 PATCHLEVEL = 11 SUBLEVEL = 0 Change-Id: Ic394d1fd5cac6ee6dfb34f2b5592e7d5c8c8fb8c Signed-off-by: Regid Ichira <regid23@nt1.in> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356886 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13drivers: thermal: add check when unregistering cpu coolingEduardo Valentin
This patch avoids NULL pointer accesses while unregistering cpu cooling devices, in case a NULL pointer is received. Change-Id: I24bba42b2d2c638aa25d65262982e2dbdbce5f08 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356885 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: thermal_core: allow binding with limits on bind_paramsEduardo Valentin
When registering a thermal zone device using platform information via bind_params, the thermal framework will always perform the cdev binding using the lowest and highest limits (THERMAL_NO_LIMIT). This patch changes the data structures so that it is possible to inform what are the desired limits for each trip point inside a bind_param. The way the binding is performed is also changed so that it uses the new data structure. Change-Id: I60c047c508ab229bfacd7b5afb885c6eb2bdda43 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356884 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13drivers: thermal: make usage of CONFIG_THERMAL_HWMON optionalEduardo Valentin
When registering a new thermal_device, the thermal framework will always add a hwmon sysfs interface. This patch adds a flag to make this behavior optional. Now when registering a new thermal device, the caller can optionally inform if hwmon interface is desirable. This can be done by means of passing a thermal_zone_params.no_hwmon == true. In order to keep same behavior as of today, all current calls will by default create the hwmon interface. Change-Id: I8e3176fa8d309fac1c716cf87dea98937125205c Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: Zhang Rui <rui.zhang@intel.com> Suggested-by: Wei Ni <wni@nvidia.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356883 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13drivers: thermal: parent virtual hwmon with thermal zoneEduardo Valentin
When creating virtual hwmon devices based out of thermal zone devices, the virtual devices won't have parents. This patch changes the code so that the parent of virtual hwmon devices is the thermal zone device that they are based of. Change-Id: Id200409ea8ba1a8c2d59cf216d51af1769dbb6c8 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356882 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: hwmon: move hwmon support to single fileEduardo Valentin
In order to improve code organization, this patch moves the hwmon sysfs support to a file named thermal_hwmon. This helps to add extra support for hwmon without scrambling the code. In order to do this move, the hwmon list head is now using its own locking. Before, the list used the global thermal locking. Also, some minor changes in the code were required, as recommended by checkpatch.pl. Change-Id: I24ba1f4a527fc3a1915b72578e08477f56fb10a4 Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356881 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: step_wise: return instance->target by defaultEduardo Valentin
In case the trend is not changing or when there is no request for throttling, it is expected that the instance would not change its requested target. This patch improves the code implementation to cover for this expected behavior. With current implementation, the instance will always reset to cdev.cur_state, even in not expected cases, like those mentioned above. This patch changes the step_wise governor implementation of get_target so that we accomplish: (a) - default value will be current instance->target, so we do not change the thermal instance target unnecessarily. (b) - the code now it is clear about what is the intention. There is a clear statement of what are the expected outcomes (c) - removal of hardcoded constants, now it is put in use the THERMAL_NO_TARGET macro. (d) - variable names are also improved so that reader can clearly understand the difference between instance cur target, next target and cdev cur_state. Change-Id: Ia2b90a689e4587f6c4cbf0573bd527e36cf4abb9 Cc: Zhang Rui <rui.zhang@intel.com> Cc: Durgadoss R <durgadoss.r@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reported-by: Ruslan Ruslichenko <ruslan.ruslichenko@ti.com> Signed-of-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356880 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13thermal: step_wise: cdev only needs update on a new target stateShawn Guo
The cooling device only needs update on a new target state. Since we already check old target in thermal_zone_trip_update(), we can do one more check to see if it's a new target state. If not, we can reasonably save some uncecesary code execution. Change-ID: I4a2e7c078d9e02ece7d4e571079898b6e3ef2821 Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356879 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-13Thermal/cpu_cooling: Return directly for the cpu out of allowed_cpus in the ↵Lan Tianyu
cpufreq_thermal_notifier() cpufreq_thermal_notifier() is to change the cpu's cpufreq in the allowed_cpus mask when associated thermal-cpufreq cdev's cooling state is changed. It's a cpufreq policy notifier handler and it will be triggered even if those cpus out of allowed_cpus has changed freq policy. cpufreq_thermal_notifier() checks the policy->cpu. If it belongs to allowed_cpus, change max_freq(default to 0) to the desire cpufreq value and pass 0 and max_freq to cpufreq_verify_within_limits() as cpufreq scope. But if not, do nothing and max_freq will remain 0. This will cause the cpufreq scope to become 0~0. This is not right. This patch is to return directly after finding cpu not belonging to allowed_cpus. Change-Id: I88dd6d71f20a06e78b813520cd9082ad85321b30 Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356878 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-12thermal: pwm-fan: lock during sysfs writesAnshul Jain
This change locks the whole sysfs function to ensure atomicity. Also, more logs are added for better visibility during suspend and resume. Bug 1388303 Change-Id: Iadf8bdc4309575ec42a1946ecfb28eb7654440e3 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/299756 (cherry picked from commit 5eec7cd755f9c8dbdc826d63f10b30cad237eb5d) Reviewed-on: http://git-master/r/347142 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-10Thermal: core: Ask .get_trip_temp() to register thermal zone device.Jonghwa Lee
This patch adds a requirement needing .get_trip_temp() callback function for registering thermal zone device. This function is used when thermal zone is updated and essential where thermal core handles thermal trip based only polling way not hw interrupt. Change-Id: I48606964fb14276290ac428cf75fd0824e3b923e Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356875 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-10thermal: cut the spaces when user sets policyAndy Shevchenko
Setting policy results in invalid value error. % echo "step_wise" > policy % echo: write error: Invalid argument Need clean up of the buffer which "echo" may add based on the arguments, before comparing aganist list of governor names. Change-Id: Ifbb8db53b58c166e2328ddd64618dd9bdec07c78 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Tested-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356874 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-10thermal: consider emul_temperature while computing trendEduardo Valentin
In case emulated temperature is in use, using the trend provided by driver layer can lead to bogus situation. In this case, debugger user would set a temperature value, but the trend would be from driver computation. To avoid this situation, this patch changes the get_tz_trend() to consider the emulated temperature whenever that is in use. Change-Id: I509a24e8f398e5655589f0c7d24dcaeda81d9a9b Cc: Zhang Rui <rui.zhang@intel.com> Cc: Amit Daniel Kachhap <amit.daniel@samsung.com> Cc: Durgadoss R <durgadoss.r@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356877 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-02-10thermal: cpu_cooling: fix 'descend' check in get_property()Shawn Guo
The variable 'descend' is initialized as -1 in function get_property(), and will never get any chance to be updated by the following code. if (freq != CPUFREQ_ENTRY_INVALID && descend != -1) descend = !!(freq > table[i].frequency); This makes function get_property() return the wrong frequency for given cooling level if the frequency table is sorted in ascending. Fix it by correcting the 'descend' check in if-condition to 'descend == -1'. Change-Id: If7b12af2af5c795ec40d89dd8e2e7a31d50cfa8c Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> # for the NVIDIA downstream kernel Reviewed-on: http://git-master/r/356876 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2014-01-15thermal: tmp006: fail probe if device not presentPreetham Chandru R
Fail probe if device is not present Bug 1397494 Change-Id: If7609423db3e72d01315480709da923786969d4a Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: http://git-master/r/350182 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-12-19thermal: tmp006: Add skin temperature supportPreetham Chandru R
Add tmp006 skin temperature monitoring support Bug 1397494 Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Change-Id: I5ebe460fbb0bef891547c25ef86a9521f6f3efbd Reviewed-on: http://git-master/r/331571 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-12-12thermal: palmas: Add Hot-Die state informationJinyoung Park
Added Hot-Die state information in interrupt handler. Change-Id: I02398843d95e6477a918c05755bfb641d295c952 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/343896 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2013-12-12thermal: palmas: Add palmas data into driver dataJinyoung Park
Added the palmas data into the driver data in order to be referred in callbacks. Change-Id: I8564fb1e73a2d882c025de982658a93cb6b1472a Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/344624 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2013-11-15thermal: Update THERMAL_MAX_TRIPS to 48Sai Gurrappadi
Also changed mask field from int to u64 to support the larger trip point number. Change-Id: I5ab2b381de8094ed0477998ec300164b51e81d7f Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com> Reviewed-on: http://git-master/r/327982 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2013-11-15Thermal: Add temperature to thermal netlink eventSai Gurrappadi
Let the thermal netlink event carry temperature along with the payload. Change-Id: I978371388344d0d2568b9a955984055eb0afbd07 Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com> Reviewed-on: http://git-master/r/332010 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2013-11-09thermal: pwm_fan: toggle gpio in suspend/resumeAnshul Jain
On suspend, this change sets the gpio high. On suspend: free pwm request gpio set gpio high On resume: free gpio request pwm set pwm Bug 1388303 Bug 1399542 Change-Id: I6905e4217dd170801d84ec98713067e5c2a53abf Reviewed-by: Manish Tuteja <mtuteja@nvidia.com> Reviewed-on: http://git-master/r/302591 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/325897 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-11-08thermal: pwm_fan: Node to change state-pwm mappingAnshul Jain
This change creates /sys/devices/platform/pwm-fan/pwm_state_map node, pwm values can be changed using these nodes at various trip points. echo "<state> <pwm>" > /sys/devices/platform/pwm-fan/pwm_state_map Bug 1364451 Change-Id: Ib8487b948a84867a0084d9ab49e815e23b14419a Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/304038 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com>
2013-09-30!FIXUP: boot issues with latest merge from mainBharat Nihalani
Change-Id: I47e7cbfd840df5871d24664fdf15311e7ba65e23 Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-on: http://git-master/r/280243 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com> Tested-by: Ajay Nandakumar M <anandakumarm@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2013-09-16thermal: generic-adc-thermal: Support channel reading with dual modeJinyoung Park
Support channel reading with dual mode. This channel reading with dual mode is required to do the series resistance cancellation for thermal diode sensing. Bug 1287901 Bug 1356128 Change-Id: Id50ffa81a38f087b2abc0a23a9db5dd829b4198f Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/273637 GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-09-14thermal: Add palmas thermal supportPradeep Goudagunta
Palmas series pmic chip supports hot die interrupt configurable for four different critical temperature thresholds. Bug 1355680 Change-Id: I0167d5faf5be596018ec34d67911dd631d2cc71f Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com> Reviewed-on: http://git-master/r/267913 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-09-14Thermal: sys node to read and write polling_delayDiwakar Tundlam
Bug 1315460 Change-Id: I7dca29c63d5238522b1cd9df680dc7c019674066 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/250905 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com>
2013-09-14thermal: generic-adc: call appropriate iio_* apisLaxman Dewangan
On Kernel K3.8, the iio generic apis has been changed from iio_st* to iio_*. Modifying driver to use the appropriate public APIs. Change-Id: Id8195a85b61359845269673a937c754d4ba4990f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/251630 Reviewed-by: Automatic_Commit_Validation_User