summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra11_soctherm.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2014-03-27 16:15:26 -0700
committerDiwakar Tundlam <dtundlam@nvidia.com>2014-03-28 13:02:45 -0700
commit4a0d98f36300a8dae295e3e92ee38e3ee9d2667e (patch)
tree50d39b4e4f730c8e8896f70803b13dc79f34f7fe /arch/arm/mach-tegra/tegra11_soctherm.c
parentbc9722ed6f785218b7d3000ee80e2aeef5acb499 (diff)
arm: tegra: thermal: use correct zone pointer
The global index of thermal zones from thermal framework will be different from the 0-based soctherm driver's own index. Use the global index to notify framework, not the local index. Local index is used to program the HW, and is derived from the stored devdata. This fixes hw programming of thresholds in the wrong zone when written from the trip_point_x_temp sysfs node. This doesn't directly affect the bug mentioned below, but fixes a problem that occurs when trying to repro it. Bug 1482109 Change-Id: Ib03b719a51d296d3b77e99c53bcb68742576e3bb Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/387984 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch/arm/mach-tegra/tegra11_soctherm.c')
-rw-r--r--arch/arm/mach-tegra/tegra11_soctherm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/tegra11_soctherm.c b/arch/arm/mach-tegra/tegra11_soctherm.c
index 393a0ecf8c93..58b26eee6f46 100644
--- a/arch/arm/mach-tegra/tegra11_soctherm.c
+++ b/arch/arm/mach-tegra/tegra11_soctherm.c
@@ -1397,6 +1397,7 @@ static int soctherm_set_trip_temp(struct thermal_zone_device *thz,
{
struct soctherm_therm *therm = thz->devdata;
struct thermal_trip_info *trip_state;
+ ptrdiff_t index = therm - plat_data.therm;
long rem;
trip_state = &therm->trips[trip];
@@ -1412,18 +1413,18 @@ static int soctherm_set_trip_temp(struct thermal_zone_device *thz,
if (trip_state->trip_type == THERMAL_TRIP_HOT) {
if (strnstr(trip_state->cdev_type,
"heavy", THERMAL_NAME_LENGTH))
- prog_hw_threshold(trip_state, thz->id, THROTTLE_HEAVY);
+ prog_hw_threshold(trip_state, index, THROTTLE_HEAVY);
else if (strnstr(trip_state->cdev_type,
"light", THERMAL_NAME_LENGTH))
- prog_hw_threshold(trip_state, thz->id, THROTTLE_LIGHT);
+ prog_hw_threshold(trip_state, index, THROTTLE_LIGHT);
}
/* Allow SW to shutdown at 'Critical temperature reached' */
- thermal_notify_framework(soctherm_th_zones[thz->id], trip);
+ thermal_notify_framework(thz, trip);
/* Reprogram HW thermtrip */
if (trip_state->trip_type == THERMAL_TRIP_CRITICAL)
- prog_hw_shutdown(trip_state, thz->id);
+ prog_hw_shutdown(trip_state, index);
return 0;
}