03 Sep, 2013
5 commits
-
This patch avoids NULL pointer accesses while unregistering
cpu cooling devices, in case a NULL pointer is received.Cc: Zhang Rui
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo 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.Cc: Zhang Rui
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo 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.Cc: David Woodhouse
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
Suggested-by: Wei Ni
Signed-off-by: Eduardo 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.Cc: Zhang Rui
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo 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.Cc: Zhang Rui
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Durgadoss R
Signed-off-by: Eduardo Valentin
29 Aug, 2013
6 commits
-
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
Signed-off-by: Eduardo Valentin -
NULL pointer was being dereferenced in its own error message.
Changed it to the correct device pointer.Signed-off-by: Sachin Kamat
Signed-off-by: Eduardo Valentin -
Fixes some trivial typos.
Signed-off-by: Sachin Kamat
Signed-off-by: Eduardo Valentin -
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
Signed-off-by: Eduardo Valentin -
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
Signed-off-by: Eduardo Valentin -
Initialize MPU, GPU, CORE, DSPEVE and IVA thermal sensors of DRA752 bandgap
with the counter delay mask.Signed-off-by: Ranganath Krishnan
Signed-off-by: Eduardo Valentin
15 Aug, 2013
8 commits
-
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
Cc: Durgadoss R
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reported-by: Ruslan Ruslichenko
Signed-of-by: Eduardo Valentin
Signed-off-by: Zhang Rui -
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
Acked-by: Eduardo Valentin
Signed-off-by: Zhang Rui -
…req_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> -
The error check is checking for a "base" mapped memory base
instead of "base_common". Fixing the same.Signed-off-by: Naveen Krishna Chatradhi
Signed-off-by: Zhang Rui -
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
Acked-by: Shawn Guo
Signed-off-by: Zhang Rui -
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
Acked-by: Shawn Guo
Signed-off-by: Zhang Rui
13 Aug, 2013
21 commits
-
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
Acked-by: Eduardo Valentin
Signed-off-by: Lukasz Majewski
Signed-off-by: Kyungmin Park
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Kukjin Kim
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
This patch sets the second point trimming value according to the platform
data if the register value is 0.Acked-by: Jonghwa Lee
Acked-by: Kukjin Kim
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
This patch adds configuration data for exynos5440 soc. Also register
definations for the controller are added.Acked-by: Jonghwa Lee
Acked-by: Kukjin Kim
Signed-off-by: Amit Daniel Kachhap
Acked-by: Eduardo Valentin
Signed-off-by: Eduardo Valentin -
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
Acked-by: Kukjin Kim
Signed-off-by: Jungseok Lee
Signed-off-by: Amit Daniel Kachhap
Acked-by: Eduardo Valentin
Signed-off-by: Eduardo Valentin -
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
Acked-by: Kukjin Kim
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
This patch uses the device pointer stored in the configuration structure
and converts to dev_* prints and devm API's.Acked-by: Kukjin Kim
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Signed-off-by: Amit Daniel Kachhap
Acked-by: Eduardo Valentin
Signed-off-by: Eduardo Valentin -
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
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
This patch uses the TMU status register to know the generated interrupts
and only clear them in the interrupt handler.Acked-by: Kukjin Kim
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Jonghwan Choi
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Signed-off-by: Amit Daniel Kachhap
Acked-by: Eduardo Valentin
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Signed-off-by: Amit Daniel Kachhap
Acked-by: Eduardo Valentin
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin -
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
Acked-by: Jonghwa Lee
Acked-by: Eduardo Valentin
Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Eduardo Valentin