arm: tegra: soctherm: No hysteresis needed since HW has it implicitly
Diwakar Tundlam [Thu, 14 Mar 2013 02:00:44 +0000 (19:00 -0700)]
Due to the way HW implements up and down threholds for a trip_point,
there is an implicit hysteresis of about 1C. Additional hysteresis is
not needed.

Removed setting default hysteresis in driver and edp cooling device.

If additional hysteresis is needed, setting it in trip_info in board
files will take effect as before for PASSIVE trip points.

Bug 1250096

Change-Id: I84597bccc46f19f02b4fa710035f13dd9102e2f3
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/209376
(cherry picked from commit 20562e8399e9299d34029e681c2eb1757f5894aa)
Reviewed-on: http://git-master/r/210453
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/edp.c
arch/arm/mach-tegra/tegra11_soctherm.c

index 0fe849d..a3f6e18 100644 (file)
@@ -932,7 +932,6 @@ void tegra_platform_edp_init(struct thermal_trip_info *trips,
                        (cpu_edp_limits[i].temperature * 1000) - margin;
                trip_state->trip_type = THERMAL_TRIP_ACTIVE;
                trip_state->upper = trip_state->lower = i + 1;
-               trip_state->hysteresis = 1000;
 
                (*num_trips)++;
 
index 26af6d6..544bc66 100644 (file)
@@ -563,10 +563,6 @@ static inline void prog_hw_threshold(struct thermal_trip_info *trip_state,
        r = soctherm_readl(reg_off);
        r = REG_SET(r, CTL_LVL0_CPU0_UP_THRESH, trip_temp);
 
-       trip_state->hysteresis = trip_state->hysteresis ?:
-               LOWER_PRECISION_FOR_CONV(1000);
-       trip_temp -= LOWER_PRECISION_FOR_TEMP(trip_state->hysteresis / 1000);
-
        r = REG_SET(r, CTL_LVL0_CPU0_DN_THRESH, trip_temp);
        r = REG_SET(r, CTL_LVL0_CPU0_EN, 1);
        r = REG_SET(r, CTL_LVL0_CPU0_CPU_THROT,
@@ -727,8 +723,6 @@ static int soctherm_bind(struct thermal_zone_device *thz,
                trip_state = &plat_data.therm[index].trips[i];
                if (trip_state->bound)
                        continue;
-               trip_state->hysteresis = trip_state->hysteresis ?:
-                       LOWER_PRECISION_FOR_CONV(1000);
                if (trip_state->cdev_type &&
                    !strncmp(trip_state->cdev_type, cdev->type,
                                                THERMAL_NAME_LENGTH)) {