summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorJoshua Primero <jprimero@nvidia.com>2011-09-08 16:23:22 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:50 -0800
commitfd3237e589268b87c7bffa362472632fdae4c449 (patch)
tree34eb58114a7fb75165d3f8fc919a1ef6c8133d49 /drivers/misc
parentc57bc1998691279b15ddd831c5bb0b7d475c1aa1 (diff)
arm: tegra: power: Reduced throttling hysteresis
Set different hysteresis values for the EDP and throttling cases. bug 862301 (cherry picked from commit 357e8bcd3df61ff2803049e38e8a99dfbcaee99b) Change-Id: I6cb3ea9bf7f9e288e2b1481862b8aee214ca853f Reviewed-on: http://git-master/r/62569 Reviewed-by: Joshua Primero <jprimero@nvidia.com> Tested-by: Joshua Primero <jprimero@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Rebase-Id: Rfd9c2c7990606c4ed0a10f534a15d2d589327d53
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/nct1008.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c
index 0a56485d5ae6..54c8c43d2330 100644
--- a/drivers/misc/nct1008.c
+++ b/drivers/misc/nct1008.c
@@ -553,7 +553,8 @@ static void therm_throttle(struct nct1008_data *data, bool enable)
}
}
-#define ALERT_HYSTERESIS 3
+#define ALERT_HYSTERESIS_THROTTLE 1
+#define ALERT_HYSTERESIS_EDP 3
static int edp_thermal_zone_val = -1;
static int current_hi_limit = -1;
static int current_lo_limit = -1;
@@ -565,6 +566,7 @@ static void nct1008_work_func(struct work_struct *work)
bool extended_range = data->plat_data.ext_range;
u8 temperature, value;
int err = 0, i;
+ int hysteresis;
int nentries = data->limits_sz;
int lo_limit = 0, hi_limit = 0;
int intr_status;
@@ -594,32 +596,37 @@ static void nct1008_work_func(struct work_struct *work)
return;
}
+
+ hysteresis = ALERT_HYSTERESIS_EDP;
+
+ if (temperature >= data->plat_data.throttling_ext_limit) {
+ /* start throttling */
+ therm_throttle(data, true);
+ hysteresis = ALERT_HYSTERESIS_THROTTLE;
+ } else if (temperature <=
+ (data->plat_data.throttling_ext_limit -
+ ALERT_HYSTERESIS_THROTTLE)) {
+ /* switch off throttling */
+ therm_throttle(data, false);
+ }
+
if (temperature < data->limits[0]) {
lo_limit = 0;
hi_limit = data->limits[0];
} else if (temperature >= data->limits[nentries-1]) {
- lo_limit = data->limits[nentries-1] - ALERT_HYSTERESIS;
+ lo_limit = data->limits[nentries-1] - hysteresis;
hi_limit = data->plat_data.shutdown_ext_limit;
} else {
for (i = 0; (i + 1) < nentries; i++) {
if (temperature >= data->limits[i] &&
temperature < data->limits[i + 1]) {
- lo_limit = data->limits[i] - ALERT_HYSTERESIS;
+ lo_limit = data->limits[i] - hysteresis;
hi_limit = data->limits[i + 1];
break;
}
}
}
- if (temperature >= data->plat_data.throttling_ext_limit) {
- /* start throttling */
- therm_throttle(data, true);
- } else if (temperature <=
- (data->plat_data.throttling_ext_limit - ALERT_HYSTERESIS)) {
- /* switch off throttling */
- therm_throttle(data, false);
- }
-
if (lo_limit == hi_limit) {
err = -ENODATA;
goto out;