15 Sep, 2017
1 commit
-
From MX7D Fuse Map v2.9, the thermal grade register is 0x440[7:6],
not 0x480[7:6] as before.Fixes: 2045abb4391a ("MLK-11518-01 thermal: imx: add thermal support for imx7")
Reviewed-by: Bai Ping
Signed-off-by: Dong Aisheng
(cherry picked from commit add734018577b490840e1d19c2640bcad0e4bda9)
19 Jun, 2017
1 commit
-
On i.MX7D, if the system enter LPSR mode, the tempmon module
will be power down, so the regiter's value is lost, so we need
to save the registers before suspend and restore the register after
resume back.Signed-off-by: Bai Ping
(cherry picked from commit 72e6a05b52d24b4976c5f012a185c049f0e6ffa6)
08 Jun, 2017
1 commit
-
When setting passive temperature trip point, it is not
allowed to set a higher value than the default.Currently the driver compares the new temperature to set
with a constant (0). This comparison wil always be true
(temp to set higher than 0) and the driver will return
-EINVAL. This is a leftover from rebasing the commit fc4fcd689419
("MLK-11705 thermal: imx: make the critical trip temp changable for test").Fix the comparison by using the actual default passive
temperature value instead of the wrong constant.Signed-off-by: Irina Tirdea
23 Feb, 2017
8 commits
-
unregister the busfreq_notifier when the thermal driver is removed.
Signed-off-by: Bai Ping
-
On i.MX7D TO1.0, the finish bit in tempmon module used for verify
the temp value is broken, so it can NOT be used for checking the temp
value. On TO1.1, this issue has been fixed, so we can use this bit
to verify if the temp value is valid.Signed-off-by: Bai Ping
-
In order to test the critical trip point funtion, the
critical trip point temp should be writable from userspace.Signed-off-by: Bai Ping
-
As thermal sensor alarm function needs PLL3 to be always on, but low power
idle needs all PLLs to be off, they are exclusive. Low power idle is only enabled
when system staying at low bus mode which means the overall system power consumption
is NOT high, thermal alarm function can be disabled in this mode to allow low power
idle to be entered, and thermal sensor will still use polling mechanism to monitor
the system temperature. Add busfreq notify to achieve this goal.
(this patch is copied from commit dd3d1e6c6ff0)Signed-off-by: Bai Ping
-
Enable devfreq cooling to trigger GPU freq change when
hot trip is reached.Make sure thermal driver loaded after cpufreq is loaded,
otherwise, cpu_cooling will not get valid cpufreq table,
hence cpu_cooling will be not working.Signed-off-by: Bai Ping
-
add .get_trend callback to determine the thermal raise/fall trend,
when the temp great than a threshold, drop to the lowest trend
(THERMAL_TREND_DROP_FULL).Signed-off-by: Bai Ping
-
This pacth re-write part of the code the support i.MX6 and i.MX7
in thermal driver. the TEMPMON module in i.MX6 and i.MX7 can provide
the same funtion, but has different register offset and bitfield define.Signed-off-by: Bai Ping
-
this patch is chery-picked from imx_3.14.y
(cherry picked from commit 51e376b469c)
ENGR00274056-1 thermal: add device cooling for thermal drivercpu cooling is not enough when temperature is
too hot, as some devices may contribute a lot of heat
to SOC, such as GPU, so we need to add device cooling
as well, when system is too hot, devices can also take
their actions to lower SOC temperature.when temperature cross the passive trip, device cooling
driver will send out notification, those devices who
register this devfreq_cooling notification will take
actions to lower SOC temperature.Signed-off-by: Anson Huang
Signed-off-by: Shawn Guo
Signed-off-by: Bai Ping
09 Jan, 2017
1 commit
-
commit f37fabb8643eaf8e3b613333a72f683770c85eca upstream.
In the critical sysfs entry the thermal hwmon was returning wrong
temperature to the user-space. It was reporting the temperature of the
first trip point instead of the temperature of critical trip point.For example:
/sys/class/hwmon/hwmon0/temp1_crit:50000
/sys/class/thermal/thermal_zone0/trip_point_0_temp:50000
/sys/class/thermal/thermal_zone0/trip_point_0_type:active
/sys/class/thermal/thermal_zone0/trip_point_3_temp:120000
/sys/class/thermal/thermal_zone0/trip_point_3_type:criticalSince commit e68b16abd91d ("thermal: add hwmon sysfs I/F") the driver
have been registering a sysfs entry if get_crit_temp() callback was
provided. However when accessed, it was calling get_trip_temp() instead
of the get_crit_temp().Fixes: e68b16abd91d ("thermal: add hwmon sysfs I/F")
Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Zhang Rui
Signed-off-by: Greg Kroah-Hartman
21 Nov, 2016
1 commit
-
Commit 3105f234e0aba43e44e277c20f9b32ee8add43d4 replaced module
cpu id table with a cpu feature check, which is logically correct.
But we need the module device table to allow module auto loading.Cc: stable@vger.kernel.org # 4.8
Fixes:3105f234 thermal/powerclamp: correct cpu support check
Signed-off-by: Jacob Pan
Signed-off-by: Zhang Rui
20 Oct, 2016
3 commits
-
Initial logic for checking CPU match resulted in OR of CPU features
rather than the intended AND.Updated to use boot_cpu_has macro rather than x86_match_cpu.
In addition, MWAIT is the only required CPU feature for idle
injection to work. Drop other feature requirements since they are
only needed for optimal efficiency.CC: stable@vger.kernel.org #v4.7
Signed-off-by: Eric Ernst
Acked-by: Jacob Pan
Signed-off-by: Zhang Rui -
Added missing support for Haswell PCH thermal sensor.
Signed-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui -
On the platforms which has an ACPI companion device associated with
PCH thermal device, read passive trip temperature via ACPI _PSV
control method.Signed-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui
13 Oct, 2016
1 commit
-
Pull thermal managament updates from Zhang Rui:
- Enhance thermal "userspace" governor to export the reason when a
thermal event is triggered and delivered to user space. From Srinivas
Pandruvada- Introduce a single TSENS thermal driver for the different versions of
the TSENS IP that exist, on different qcom msm/apq SoCs'. Support for
msm8916, msm8960, msm8974 and msm8996 families is also added. From
Rajendra Nayak- Introduce hardware-tracked trip points support to the device tree
thermal sensor framework. The framework supports an arbitrary number
of trip points. Whenever the current temperature is changed, the trip
points immediately below and above the current temperature are found,
driver callback is invoked to program the hardware to get notified
when either of the two trip points are triggered. Hardware-tracked
trip points support for rockchip thermal driver is also added at the
same time. From Sascha Hauer, Caesar Wang- Introduce a new thermal driver, which enables TMU (Thermal Monitor
Unit) on QorIQ platform. From Jia Hongtao- Introduce a new thermal driver for Maxim MAX77620. From Laxman
Dewangan- Introduce a new thermal driver for Intel platforms using WhiskeyCove
PMIC. From Bin Gao- Add mt2701 chip support to MTK thermal driver. From Dawei Chien
- Enhance Tegra thermal driver to enable soctherm node and set
"critical", "hot" trips, for Tegra124, Tegra132, Tegra210. From Wei
Ni- Add resume support for tango thermal driver. From Marc Gonzalez
- several small fixes and improvements for rockchip, qcom, imx, rcar,
mtk thermal drivers and thermal core code. From Caesar Wang, Keerthy,
Rocky Hao, Wei Yongjun, Peter Robinson, Bui Duc Phuc, Axel Lin, Hugh
Kang* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (48 commits)
thermal: int3403: Process trip change notification
thermal: int340x: New Interface to read trip and notify
thermal: user_space gov: Add additional information in uevent
thermal: Enhance thermal_zone_device_update for events
arm64: tegra: set hot trips for Tegra210
arm64: tegra: set critical trips for Tegra210
arm64: tegra: add soctherm node for Tegra210
arm64: tegra: set hot trips for Tegra132
arm64: tegra: set critical trips for Tegra132
arm64: tegra: use tegra132-soctherm for Tegra132
arm: tegra: set hot trips for Tegra124
arm: tegra: set critical trips for Tegra124
thermal: tegra: add hw-throttle for Tegra132
thermal: tegra: add hw-throttle function
of: Add bindings of hw throttle for Tegra soctherm
thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
thermal: Add Mediatek thermal driver for mt2701.
dt-bindings: thermal: Add binding document for Mediatek thermal controller
thermal: max77620: Add thermal driver for reporting junction temp
thermal: max77620: Add DT binding doc for thermal driver
...
27 Sep, 2016
23 commits
-
When ACPI sends notification for trip point change re-read trips and
notify thermal core, so that this can be passed to user space thermal
controller.Signed-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui -
Separated the code for reading trip points from int340x_thermal_zone_add to
a standalone function int340x_thermal_read_trips. This standlone
interface to read is exported so that int340x drivers can re-read trips
on ACPI notification for trip point change.
Also the appropriate notification events are sent by int340x driver based
on the acpi event using int340x_thermal_zone_device_update().Signed-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui -
Add additional properties:
NAME= Thermal zone type
TEMP= Temperature sample value
TRIP= Violated trip index
EVENT= The notification event (new temperature sample, trip violation
trip changed)This is the additional information to what kobject_uevent already
provides. So it will not impact existing user spaces.Signed-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui -
Added one additional parameter to thermal_zone_device_update() to provide
caller with an optional capability to specify reason.
Currently this event is used by user space governor to trigger different
processing based on event code. Also it saves an additional call to read
temperature when the event is received.
The following events are cuurently defined:
- Unspecified event
- New temperature sample
- Trip point violated
- Trip point changed
- thermal device up and down
- thermal device power capability changedSigned-off-by: Srinivas Pandruvada
Signed-off-by: Zhang Rui -
…-hw-throttle' into next
-
Tegra132 use CCROC throttle registers to configure
pulse skiper, set these registers to enable throttle
function for Tegra132.Signed-off-by: Wei Ni
Signed-off-by: Zhang Rui -
Tegra soctherm support HW throttle, when the soctherm snesors'
temperature is above the throttle trip point, it will trigger
pulse skiper to tune clocks accroding to the throttle depth.
Add this function for Tegra124 and Tegra210.
Since Tegra132 use different registers to configure pulse skiper,
will support it in next patch.Signed-off-by: Wei Ni
Signed-off-by: Zhang Rui -
devm_thermal_zone_of_sensor_register can fail, so check it's return value.
Signed-off-by: Axel Lin
Reviewed-by: Matthias Brugger
Signed-off-by: Zhang Rui -
This patch adds support for mt2701 chip to mtk_thermal,
and integrate both mt8173 and mt2701 on the same driver.
MT8173 has four banks and five sensors, and MT2701 has
only one bank and three sensors.Signed-off-by: Dawei Chien
Signed-off-by: Zhang Rui -
Maxim Semiconductor Max77620 supports alarm interrupts when
its die temperature crosses 120C and 140C. These threshold
temperatures are not configurable.Add thermal driver to register PMIC die temperature as thermal
zone sensor and capture the die temperature warning interrupts
to notifying the client.Signed-off-by: Laxman Dewangan
Signed-off-by: Zhang Rui -
When this platform is suspended, firmware powers the entire SoC down,
except a few hardware blocks waiting for wakeup events. There is no
context to save for this particular block.Therefore, there is nothing useful for the driver to do on suspend;
so we define a NULL suspend hook. On resume, the driver initializes
the block exactly as is done in the probe callback.Signed-off-by: Marc Gonzalez
Reviewed-by: Kevin Hilman
Signed-off-by: Zhang Rui -
We could see that state is defined as unsigned type, so it
should never be less than zero. Let' remove this check.Signed-off-by: Shawn Lin
Reviewed-by: Chanwoo Choi
Signed-off-by: Zhang Rui -
devm_thermal_zone_of_sensor_register() case doesn't need to call
thermal_zone_device_unregister().
Otherwise, rcar-thermal can't register thermal zone again after rebind.
This patch fixes it.Signed-off-by: Bui Duc Phuc
Signed-off-by: Kuninori Morimoto
Signed-off-by: Zhang Rui -
Signed-off-by: Zhang Rui
-
Not much use unless the SoC is selected so depend on the ARCH_MXC
and COMPILE_TEST like all the other thermal drivers.v2: drop extraneous OF
Signed-off-by: Peter Robinson
Acked-by: Shawn Guo
Signed-off-by: Zhang Rui -
In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
And the function devm_regmap_init_mmio() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().Signed-off-by: Wei Yongjun
Acked-by: Rajendra Nayak
Signed-off-by: Zhang Rui -
In less than 10 ms, the temperature of soc will arise 10 degree. 250 ms
is too big for soc tempeture control. Setting 2.5 ms will speed up
temperature accessing speed but introduce no more cpu's computing overhead.
We set AUTO_PERIOD_TIME and TSADCV3_AUTO_PERIOD_HT_TIME the same value,
because normal temperature update speed is also our consern in IPA.Signed-off-by: Rocky Hao
Signed-off-by: Caesar Wang
Cc: Zhang Rui
Cc: Eduardo Valentin
Cc: Heiko Stuebner
Cc: linux-pm@vger.kernel.org
Tested-by: Stephen Barber
Signed-off-by: Zhang Rui -
Due to the voltage ripple, the sensing data of the tsadc is not accurate.
And in this patch, the bandgap feature is enhanced to remove the voltage
ripple, and then the tsadc can sense the temperature more precisely.Obsolete codes are removed as well.
Signed-off-by: Rocky Hao
Signed-off-by: Caesar Wang
Cc: Eduardo Valentin
Cc: Zhang Rui
Cc: Heiko Stuebner
Cc: linux-pm@vger.kernel.org
Tested-by: Stephen Barber
Signed-off-by: Zhang Rui -
The newly added tsens-8916 driver produces warnings when CONFIG_PM
is disabled:drivers/thermal/qcom/tsens.c:53:12: error: 'tsens_resume' defined but not used [-Werror=unused-function]
static int tsens_resume(struct device *dev)
^~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:43:12: error: 'tsens_suspend' defined but not used [-Werror=unused-function]
static int tsens_suspend(struct device *dev)
^~~~~~~~~~~~~This marks both functions __maybe_unused to let the compiler
know that they might be used in other configurations, without
adding ugly #ifdef logic.Signed-off-by: Arnd Bergmann
Reviewed-by: Rajendra Nayak
Signed-off-by: Zhang Rui -
This driver add thermal management support by enabling TMU (Thermal
Monitoring Unit) on QorIQ platform.It's based on thermal of framework:
- Trip points defined in device tree.
- Cpufreq as cooling device registered in qoriq cpufreq driver.Signed-off-by: Jia Hongtao
Signed-off-by: Zhang Rui -
rcar-thermal is supporting both thermal_zone_of_sensor_register() and
thermal_zone_device_register(). But thermal_zone_of_sensor_register()
doesn't enable hwmon as default.
This patch enables it to keep compatibilitySigned-off-by: Kuninori Morimoto
Signed-off-by: Zhang Rui -
Currently thermal zone set_emul_temp is set unconditionally
with of_thermal_set_emul_temp function. Set this only if the
set_emul_temp hook is provided for thermal_zone_of_device_ops.This fixes emul_temp failures on platforms for which set_emul_temp
hook is not populated.Fixes: "184a4bf623f (thermal: of: Extend current
of-thermal.c code to allow setting emulated temp)"
Suggested-by: Eduardo Valentin
Signed-off-by: Keerthy
Signed-off-by: Eduardo ValentinConflicts:
drivers/thermal/of-thermal.c
Signed-off-by: Zhang Rui -
The hardware-tracked trips will set the alarm interrupt value for
registers. Then when the thermal zone has no trips to be set,
That make the thermal trips callback a over range value.The root cause is the rk_tsadcv2_temp_to_code() function to handle the
invalid temperature range is indeed incorrect, let's fix it on now.
Otherwise, the thermal alarm interrupt will be triggered all the time
on some SoCs.Fox example:
localhost tmp # grep thermal /proc/interrupts; sleep 5;
grep thermal /proc/interrupts23: 994830 .. GICv3 129 Level rockchip_thermal
23: 1003423 .. GICv3 129 Level rockchip_thermalReported-by: Rocky Hao
Signed-off-by: Caesar Wang
Cc: Zhang Rui
Cc: Eduardo Valentin
Cc: Heiko Stuebner
Cc: linux-pm@vger.kernel.org
Signed-off-by: Eduardo Valentin
Signed-off-by: Zhang Rui