summaryrefslogtreecommitdiff
path: root/drivers/thermal
AgeCommit message (Collapse)AuthorFilesLines
2014-11-18thermal: exynos3250: Add interrupt mask for rising/falling interrupt to pdata.Jonghwa Lee1-0/+4
Interrupt mask will be used to clear unexpected interrupt arisen when rising/ falling thresholds are set. Change-Id: I570018c7b541a54e2b3d8dbfa2a14f2863682edb Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18thermal: samsung: Only update available threshold limitsTushar Behera1-0/+4
Currently the threshold limits are updated in 2 stages, once for all software trigger levels and again for hardware trip point. While updating the software trigger levels, it overwrites the threshold limit for hardware trip point thereby forcing the Exynos core to issue an emergency shutdown. Updating only the required fields in threshold register fixes this issue. Change-Id: I7ad7a7eadad874b5ec4ecd7fbed207c01cad4e2f Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2014-11-18thermal: Bind cooling devices with the correct argumentsPunit Agrawal1-2/+2
When binding cooling devices to thermal zones created from the device tree the minimum and maximum cooling states are in the wrong order leading to failure to bind. Fix the order of cooling states in the call to thermal_zone_bind_cooling_device to fix this. Change-Id: I63c72736ca26ff5dd1cd9e051721c4c7f3d63af5 Cc:Zhang Rui <rui.zhang@intel.com> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2014-11-18thermal: Add braces around suspect codeStephen Boyd1-1/+2
It looks like this code is missing braces, otherwise the if statement shouldn't have been indented. Fix it. Change-Id: Ia5f7b1e784e79d58e0a68851f4ccc1a42565a247 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2014-11-18thermal:samsung: fix compilation warningNaveen Krishna Chatradhi1-1/+1
This patch fixes a compilation warning. warning: passing argument 5 of 'thermal_zone_device_register' discards 'const' qualifier from pointer target type [enabled by default] include/linux/thermal.h:270:29: note: expected 'struct thermal_zone_device_ops *' but argument is of type 'const struct thermal_zone_device_ops *' Change-Id: Ide96bc2bb6a2c0c843e84811d9adaae97d8a191d Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2014-11-18thermal: introduce device tree parserEduardo Valentin5-1/+880
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: Iaecd480e8a5e21f0d3154cc9bf782bbfd051d40a 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>
2014-11-18thermal: allow registering without .get_tempEduardo Valentin1-2/+8
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: Id58d2b558bc5a946dc7d712e28c2ed7cb90cc64b 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>
2014-11-18thermal: samsung: Change calculation type from TWO_POINT_TRIMMING to ↵Chanwoo Choi1-1/+1
ONE_POINT_TRIMMING This patch changes the calculation type from TWO_POINT_TRIMMING to ONE_POINT_TRIMMING because some Exynos3250 don't support TWO_POINT_TRIMMING method. Change-Id: I04f76e6ca538b31687a1343535f40392a3a8b773 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2014-11-18thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250Chanwoo Choi4-7/+22
This patch add support for TRIM_RELOAD feature at Exynos3250. The TMU of Exynos3250 has two TRIMINFO_CON register. Change-Id: I129797121b6c5f619390c350a7783cf1d08f5697 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2014-11-18thermal: Use THERMAL_TREND_{RISING|FALLING} to indicate thermal trendsLukasz Majewski1-3/+5
Values used previously - THERMAL_TREND_{RAISE|DROP}_FULL caused thermal governor to use the maximal cooling state just after crossing the first trip point. Such behavior is not acceptable since it causes the full speed of FAN which is noisy and not really necessary. With proposed values the fan speed limit is adjusted accordingly. Change-Id: I9b2fd96dd74040a3a0ddf8465b316b167d5c834e Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18thermal: samsung: Add TMU support for Exynos3250 SoCChanwoo Choi4-2/+100
This patch adds the registers, bit fields and compatible strings required to support for the 1 TMU channels on Exynos3250. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [Add MUX address setting bits by Jonghwa Lee] Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
2014-11-18thermal: exynos: Provide initial setting for TMU's test MUX address at ↵Lukasz Majewski4-0/+13
Exynos4412 The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("thermal: exynos: Add missing definations and code cleanup") has removed setting of test MUX address value at TMU configuration setting. This field is not present on Exynos4210 and Exynos5 SoCs. However on Exynos4412 SoC it is required to set this field after reset because without it TMU shows maximal available temperature, which causes immediate platform shutdown. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2014-11-18thermal: exynos: Provide separate TMU data for Exynos4412Lukasz Majewski4-12/+37
Up till now Exynos5250 and Exynos4412 had the same definitions for TMU data. Following commit changes that, by introducing separate exynos4412_default_tmu_data structure. Since Exynos4412 was chronologically first, the corresponding name for TMU registers and default data was renamed. Additionally, new SOC_ARCH_EXYNOS4412 type has been defined. Moreover, the SOC_ARCH_EXYNOS name has been changed to SOC_ARCH_EXYNOS5250. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2014-11-18thermal: exynos: Remove check for thermal device pointer at ↵Lukasz Majewski1-2/+0
exynos_report_trigger() The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0 ("thermal: exynos: Add support for instance based register/unregister") broke check for presence of therm_dev at global thermal zone in exynos_report_trigger(). The resulting wrong test prevents thermal_zone_device_update() call, which calls handlers for situation when trip points are passed. Such behavior prevents thermal driver from proper reaction (when TMU interrupt is raised) in a situation when overheating is detected at TMU hardware. It turns out, that after exynos thermal subsystem redesign (at v3.12) this check is not needed, since it is not possible to register thermal zone without valid thermal device. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2014-11-18Revert "thermal: exynos: Set MUX bits in tmu's control register to work ↵Jonghwa Lee2-13/+0
correctly." This reverts commit e612d47f36eb9eb90ee88fd11addfe5aac8cdae4. This will be suppported later with Lukasz's pathches. Signed-off-by : Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18thermal: exynos: Set MUX bits in tmu's control register to work correctly.Jonghwa Lee2-0/+13
Exynos 4x12 and 5250 need that MUX bits in control register is set to be certain value at reset. Otherwise it'll reflect improper data when we read current sensor's value. For other Exynos series, it doesn't need. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18thermal: EXYNOS: always register TMU driver with core thermal frameworkBartlomiej Zolnierkiewicz3-24/+4
There is little sense in having separate config option for registering EXYNOS TMU driver with the core thermal framework. Fix it by integrating EXYNOS_THERMAL_CORE config option with EXYNOS_THERMAL one. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18drivers: thermal: add check when unregistering cpu coolingEduardo Valentin1-1/+5
This patch avoids NULL pointer accesses while unregistering cpu cooling devices, in case a NULL pointer is received. 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>
2014-11-18thermal: thermal_core: allow binding with limits on bind_paramsEduardo Valentin1-4/+15
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. 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>
2014-11-18drivers: thermal: make usage of CONFIG_THERMAL_HWMON optionalEduardo Valentin1-3/+5
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. 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>
2014-11-18drivers: thermal: parent virtual hwmon with thermal zoneEduardo Valentin1-1/+1
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. 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18Thermal/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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>
2014-11-18thermal: 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>