diff options
author | Joshua Primero <jprimero@nvidia.com> | 2011-12-18 15:44:25 -0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-22 11:31:16 +0530 |
commit | 32ff2dc25622e3a0367326729c5b483c64ae2f29 (patch) | |
tree | 33418ae37cf65ee5138d2f83381ee93501bc1209 /arch/arm/mach-tegra/tegra3_thermal.c | |
parent | 29a18b43d3bfeaf240094c54cb7946ba6b4975c0 (diff) |
arm: tegra: thermal: Low temp to therm algorithm
Instead of using 0C as default low temp in thermal
algorithm, query the thermal device driver for
lowest supported temperature.
Change-Id: Id1f70380ba476dec80e36ce79b42ab6f24a5d5ba
Signed-off-by: Joshua Primero <jprimero@nvidia.com>
Reviewed-on: http://git-master/r/70935
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_thermal.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra3_thermal.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/tegra3_thermal.c b/arch/arm/mach-tegra/tegra3_thermal.c index be4e7c09c806..8ad7bd5b670f 100644 --- a/arch/arm/mach-tegra/tegra3_thermal.c +++ b/arch/arm/mach-tegra/tegra3_thermal.c @@ -174,6 +174,7 @@ void tegra_thermal_alert(void *data) long temp_dev, temp_tj; long lo_limit_throttle_tj, hi_limit_throttle_tj; long lo_limit_edp_tj = 0, hi_limit_edp_tj = 0; + long temp_low_dev, temp_low_tj; int lo_limit_tj = 0, hi_limit_tj = 0; #ifdef CONFIG_TEGRA_EDP_LIMITS const struct tegra_edp_limits *z; @@ -202,8 +203,10 @@ void tegra_thermal_alert(void *data) /* Convert all temps to tj and then do all work/logic in terms of tj in order to avoid confusion */ temp_tj = dev2tj(thermal->device, temp_dev); + thermal->device->get_temp_low(thermal->device, &temp_low_dev); + temp_low_tj = dev2tj(thermal->device, temp_low_dev); - lo_limit_throttle_tj = dev2tj(thermal->device, 0); + lo_limit_throttle_tj = temp_low_tj; hi_limit_throttle_tj = thermal->temp_throttle_tj; #ifndef CONFIG_TEGRA_THERMAL_SYSFS @@ -228,7 +231,7 @@ void tegra_thermal_alert(void *data) #define EDP_TEMP_TJ(_index) edp2tj(thermal, z[_index].temperature * 1000) if (temp_tj < EDP_TEMP_TJ(0)) { - lo_limit_edp_tj = dev2tj(thermal->device, 0); + lo_limit_edp_tj = temp_low_tj; hi_limit_edp_tj = EDP_TEMP_TJ(0); } else if (temp_tj >= EDP_TEMP_TJ(zones_sz-1)) { lo_limit_edp_tj = EDP_TEMP_TJ(zones_sz-1) - @@ -247,7 +250,7 @@ void tegra_thermal_alert(void *data) } #undef EDP_TEMP_TJ #else - lo_limit_edp_tj = 0; + lo_limit_edp_tj = temp_low_tj; hi_limit_edp_tj = thermal->temp_shutdown_tj; #endif |