summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-11-15thermal: hwmon: move hwmon support to single fileEduardo Valentin5-254/+331
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. 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>
2013-11-15thermal: exynos: Clean up non-DT remnantsSachin Kamat2-19/+13
Commit 1cd1ecb6 ("thermal: exynos: Remove non DT based support") cleaned up some non-DT code. However, there were few more things needed for complete cleanup to make this driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Fix potential NULL pointer dereferenceSachin Kamat1-3/+3
NULL pointer was being dereferenced in its own error message. Changed it to the correct device pointer. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Fix typos in KconfigSachin Kamat1-5/+5
Fixes some trivial typos. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: ti-soc-thermal: Ensure to compute thermal trendRanganath Krishnan1-1/+5
Workaround to compute thermal trend even when update interval is not set. This patch will ensure to compute the thermal trend when bandgap counter delay is not set. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: ti-soc-thermal: Set the bandgap mask counter delay valueRanganath Krishnan1-0/+7
Set the bandgap mask counter_delay with the polling_delay value on registering the thermal zone. This patch will ensure to get the correct update interval for computing the thermal trend. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: ti-soc-thermal: Initialize counter_delay field for TI DRA752 sensorsRanganath Krishnan1-0/+5
Initialize MPU, GPU, CORE, DSPEVE and IVA thermal sensors of DRA752 bandgap with the counter delay mask. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: step_wise: return instance->target by defaultEduardo Valentin1-11/+18
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. 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>
2013-11-15thermal: step_wise: cdev only needs update on a new target stateShawn Guo1-0/+3
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. 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>
2013-11-15Thermal/cpu_cooling: Return directly for the cpu out of allowed_cpus in the ↵Lan Tianyu1-0/+2
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. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: exynos_tmu: fix wrong error check for mapped memoryNaveen Krishna Chatradhi1-1/+1
The error check is checking for a "base" mapped memory base instead of "base_common". Fixing the same. Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: imx: implement thermal alarm interrupt handlingPhilipp Zabel1-13/+127
Enable automatic measurements at 10 Hz and use the alarm interrupt to react more quickly to sudden temperature changes above the passive or critical temperature trip points. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: imx: dynamic passive and SoC specific critical trip pointsPhilipp Zabel1-10/+40
Set passive and critical trip point values depending on the maximum die temperature stored in the OCOTP fuses. This allows higher trip points for industrial and automotive rated i.MX6 SoCs. Also allow to configure the passive trip point from userspace. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: exynos: Support for TMU regulator defined at device treeAmit Daniel Kachhap1-0/+23
TMU probe function now checks for a device tree defined regulator. For compatibility reasons it is allowed to probe driver even without this regulator defined. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add hardware mode thermal calibration supportAmit Daniel Kachhap4-1/+44
This patch adds support for h/w mode calibration in the TMU controller. Soc's like 5440 support this features. The h/w bits needed for calibration setting are same as that of enum calibration_type. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Fix to set the second point correction valueAmit Daniel Kachhap1-4/+9
This patch sets the second point trimming value according to the platform data if the register value is 0. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add thermal configuration data for exynos5440 TMU sensorAmit Daniel Kachhap3-0/+82
This patch adds configuration data for exynos5440 soc. Also register definations for the controller are added. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add driver support for exynos5440 TMU sensorAmit Daniel Kachhap4-9/+90
This patch modifies TMU controller to add changes needed to work with exynos5440 platform. This sensor registers 3 instance of the tmu controller with the thermal zone and hence reports 3 temperature output. This controller supports upto five trip points. For critical threshold the driver uses the core driver thermal framework for shutdown. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Jungseok Lee <jays.lee@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add support to access common register for multistanceAmit Daniel Kachhap1-0/+20
This patch adds support to parse one more common set of TMU register. First set of register belongs to each instance of TMU and second set belongs to common TMU registers. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: use device resource management infrastructureAmit Daniel Kachhap1-13/+23
This patch uses the device pointer stored in the configuration structure and converts to dev_* prints and devm API's. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add TMU features to check instead of using SOC typeAmit Daniel Kachhap3-11/+52
This patch adds several features supported by TMU as bitfields. This features varies across different SOC type and comparing the features present in the TMU is more logical than comparing the soc itself. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add support to handle many instances of TMUAmit Daniel Kachhap5-118/+203
This patch adds support to handle multiple instances of the TMU controllers. This is done by removing the static structure to register with the core thermal and creating it dynamically for each instance of the TMU controller. The interrupt is made shared type to handle shared interrupts. Now since the ISR needs the core thermal framework to be registered so request_irq is moved after the core registration is done. Also the identifier of the TMU controller is extracted from device tree alias. This will be used for TMU specific initialisation. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Remove non DT based supportAmit Daniel Kachhap1-16/+1
Recently non DT support from Exynos platform is removed and hence removing non DT support from the driver also. This will help in easy maintainence. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Make the zone handling use trip informationAmit Daniel Kachhap3-28/+47
This code simplifies the zone handling to use the trip information passed by the TMU driver and not the hardcoded macros. This also helps in adding more zone support. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Return success even if no cooling data suppliedAmit Daniel Kachhap1-2/+2
This patch removes the error return in the bind/unbind routine as the platform may not register any cpufreq cooling data. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Modify private_data to appropriate name driver_dataAmit Daniel Kachhap3-4/+4
This patch renames member private_data to driver_data of the thermal zone registration structure as this item stores the driver related data and uses it to call the driver related callbacks. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add support for instance based register/unregisterAmit Daniel Kachhap3-26/+49
This code modifies the thermal driver to have multiple thermal zone support by replacing the global thermal zone variable with device data member of thermal_zone_device. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Fix to clear only the generated interruptsAmit Daniel Kachhap2-6/+7
This patch uses the TMU status register to know the generated interrupts and only clear them in the interrupt handler. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Support thermal trippingAmit Daniel Kachhap3-5/+44
TMU urgently sends active-high signal (thermal trip) to PMU, and thermal tripping by hardware logic. Thermal tripping means that PMU cuts off the whole power of SoC by controlling external voltage regulator. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Move register definitions from driver to data fileAmit Daniel Kachhap4-117/+315
This patch migrates the TMU register definition/bitfields to data file. This is needed to support SoC's which use the same TMU controller but register validity, offsets or bitfield may slightly vary across SOC's. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add extra entries in the tmu platform dataAmit Daniel Kachhap4-48/+85
This patch adds entries min_efuse_value, max_efuse_value, default_temp_offset, trigger_type, cal_type, trim_first_point, trim_second_point, max_trigger_level trigger_enable in the TMU platform data structure. Also the driver is modified to use the data passed by these new platform memebers instead of the constant macros. All these changes helps in separating the SOC specific data part from the TMU driver. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Add missing definations and code cleanupAmit Daniel Kachhap1-16/+46
This patch adds some extra register bitfield definations and cleans up the code to prepare for moving register macros and definations inside the TMU data section. In this code cleanup the TMU enable bit is correctly used as bit0 and bit1 is taken care which is reserve bit. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Bifurcate exynos tmu driver and configuration dataAmit Daniel Kachhap5-65/+126
This code splits the exynos tmu driver code into SOC specific data parts. This will simplify adding new SOC specific data to the same TMU controller. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Move exynos_thermal.h from include/* to driver/* folderAmit Daniel Kachhap4-2/+124
This patch renames and moves include/linux/platform_data/exynos_thermal.h to drivers/thermal/samsung/exynos_tmu.h. This file movement is needed as exynos SOC's are not supporting non-DT based platforms and this file now just contains exynos tmu driver related definations. Also struct freq_clip_table is now moved to exynos_thermal_common.c as it fixes the compilation issue occuring because now this new tmu header file is included in tmu driver c file and not in the common thermal header file. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Rename exynos_thermal.c to exynos_tmu.cAmit Daniel Kachhap2-4/+4
This patch renames exynos_thermal.c to exynos_tmu.c. This change is needed as this file now just contains exynos tmu driver related codes and thermal zone or cpufreq cooling registration related changes are not there anymore. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Bifurcate exynos thermal common and tmu controller codeAmit Daniel Kachhap5-419/+491
This code bifurcates exynos thermal implementation into common and sensor specific parts. The common thermal code interacts with core thermal layer and core cpufreq cooling parts and is independent of SOC specific driver. This change is needed to cleanly add support for new TMU sensors. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Remove un-necessary CPU_THERMAL dependencyAmit Daniel Kachhap1-1/+0
This patch removes the dependency on CPU_THERMAL for compiling TMU driver. This is useful for cases when only TMU controller needs to be initialised without cpu cooling action. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Use ARCH_HAS_BANDGAP config to know the supported soc'sAmit Daniel Kachhap1-1/+1
This patch uses the recently added config sybmol ARCH_HAS_BANDGAP to enable the TMU driver. This will allow adding support for new soc easily as now it is the platform responsibility to enable this config symbol for a particular soc. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Moving exynos thermal files into samsung directoryAmit Daniel Kachhap5-9/+20
This movement of files is done for easy maintenance and adding more new sensor's support for exynos platform easily . This will also help in bifurcating exynos common, sensor driver and sensor data related parts. Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: add imx thermal driver supportShawn Guo3-0/+409
This is based on the initial imx thermal work done by Rob Lee <rob.lee@linaro.org> (Not sure if the email address is still valid). Since he is no longer interested in the work and I have rewritten a significant amount of the code, I just took the authorship over from him. It adds the imx thermal support using Temperature Monitor (TEMPMON) block found on some Freescale i.MX SoCs. The driver uses syscon regmap interface to access TEMPMON control registers and calibration data, and supports cpufreq as the cooling device. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15Thermal: Fix lockup of cpu_down()Steven Rostedt1-1/+0
Commit f1a18a105 "Thermal: CPU Package temperature thermal" had code that did a get_online_cpus(), run a loop and then do a put_online_cpus(). The problem is that the loop had an error exit that would skip the put_online_cpus() part. In the error exit part of the function, it also did a get_online_cpus(), run a loop and then put_online_cpus(). The only way to get to the error exit part is with get_online_cpus() already performed. If this error condition is hit, the system will be prevented from taking CPUs offline. The process taking the CPU offline will lock up hard. Removing the get_online_cpus() removes the lockup as the hotplug CPU refcount is back to zero. This was bisected with ktest. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15Thermal: x86_pkg_temp: Limit number of pkg temp zonesSrinivas Pandruvada1-0/+5
Although it is unlikley that physical package id is set to some arbitary number, it is better to prevent in anycase. Since package temp zones use this in thermal zone type and for allocation, added a limit. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15Thermal: x86_pkg_temp: fix krealloc() misuse in in pkg_temp_thermal_device_add()Wei Yongjun1-3/+5
If krealloc() returns NULL, it doesn't free the original. So any code of the form 'foo = krealloc(foo, ...);' is almost certainly a bug. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15Thermal: x86 package temp thermal crashSrinivas Pandruvada1-2/+2
On systems with no package MSR support this caused crash as there is a bug in the logic to check presence of DTHERM and PTS feature together. Added a change so that when there is no PTS support, module doesn't get loaded. Even if some CPU comes online with the PTS feature disabled, and other CPUs has this support, this patch will still prevent such MSR accesses. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reported-by: Daniel Walker <dwalker@fifo99.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: ti-soc-thermal: use standard GPIO DT bindingsEduardo Valentin1-6/+2
This change updates the ti-soc-thermal driver to use standard GPIO DT bindings to read the GPIO number associated to thermal shutdown IRQ, in case the device features it. Previously, the code was using a specific DT bindings. As now OMAP supports the standard way to model GPIOs, there is no point in having a ti specific binding. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-15thermal: exynos: Support both EXYNOS4X12 SoCsTomasz Figa1-1/+2
EXYNOS4212 and EXYNOS4412 have the same thermal block, so there is no reason to include support only for EXYNOS4412 in this driver. Cc: linux-pm@vger.kernel.org Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-11-15thermal: fix x86_pkg_temp_thermal.c build and KconfigRandy Dunlap1-2/+1
Fix build error in x86_pkg_temp_thermal.c. It requires that X86_MCE & X86_THERMAL_VECTOR be enabled, so depend on the latter symbol, since it depends on X86_MCE (indirectly). Also, X86_PKG_TEMP_THERMAL is already inside an "if THERMAL" block, so remove that duplicated dependency. ERROR: "platform_thermal_package_rate_control" [drivers/thermal/x86_pkg_temp_thermal.ko] undefined! ERROR: "platform_thermal_package_notify" [drivers/thermal/x86_pkg_temp_thermal.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15Thermal: CPU Package temperature thermalSrinivas Pandruvada3-0/+655
This driver register CPU digital temperature sensor as a thermal zone at package level. Each package will show up as one zone with at max two trip points. These trip points can be both read and updated. Once a non zero value is set in the trip point, if the package package temperature goes above or below this setting, a thermal notification is generated. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-11-15thermal: consider emul_temperature while computing trendEduardo Valentin1-1/+2
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. 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>
2013-11-15thermal: ti-soc-thermal: add dra752 chip to device tableEduardo Valentin2-0/+11
Add support to TI dra752 chips by adapting the driver device table. 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: Zhang Rui <rui.zhang@intel.com>